Skip to content

Releases: FAIRChemistry/md-models-macro

v0.1.2

28 Dec 16:46
Compare
Choose a tag to compare

v0.1.2

  • Remove defaulting to mod export
  • Changed i32/f32 to i64/f64

Full Changelog: v0.1.1...v0.1.2

v0.1.1

23 Sep 07:46
5437bdd
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.1.0...v0.1.1

v0.1.0

01 Jul 12:26
6cf3059
Compare
Choose a tag to compare

MD-Models Macro

This macro accompanies the MD-Models crate to generate structs and enums based on a markdown data model. In the following, find a simple example usage:

use mdmodels_macro::parse_mdmodel;

parse_mdmodel!("tests/data/model.md");

fn main () {
    let obj = test::Object {
        string_value: "Hello, World!".to_string(),
        enum_value: model::SomeEnum::VALUE,
    };

    // Serialize the object
    let serialized = serde_json::to_string(&obj).unwrap();

    println!("Serialized: \n{}\n", serialized);

    // Deserialize the object
    let deserialized: test::Object = serde_json::from_str(&serialized).unwrap();

    println!("Deserialized: \n{:#?}\n", deserialized);
}