Crates.io | mdmodels |
lib.rs | mdmodels |
version | 0.1.1 |
source | src |
created_at | 2024-07-01 09:05:27.764557 |
updated_at | 2024-07-01 09:42:05.453013 |
description | A tool to generate models, code and schemas from markdown files |
homepage | |
repository | |
max_upload_size | |
id | 1288573 |
size | 355,271 |
This is a markdown parser and converter for Rust that can be used to parse markdown data model files and convert them to various formats, schemes and programming languages.
In order to install the command line tool, you can use the following command:
git clone https://github.com/JR-1991/md-models
cd md-models
cargo install --path .
The command line tool can be used to convert markdown files to various formats. The following command will convert a markdown file to Python code:
md-models -i model.md -o lib.py -l python-dataclass
This will read the input file model.md
and write the output to lib.py
using the Python dataclass template. Alternatively, you can also pass a URL as input to fetch the model remotely. For an overview of all available templates, you can use the following command:
md-models --help
The following templates are available:
python-dataclass
: Python dataclass implementation with JSON-LD supportpython-sdrdm
: Python PyDantic implementation with multiple output formatsxml-schema
: XML schema definitionjson-schema
: JSON schema definitionshacl
: SHACL shapes definitionshex
: ShEx shapes definitionThis project uses GitHub Actions for continuous integration. The tests can be run using the following command:
cargo test
cargo clippy