md2data

Crates.iomd2data
lib.rsmd2data
version0.1.4
created_at2025-12-01 08:51:09.935372+00
updated_at2025-12-01 09:33:17.944249+00
descriptionCLI and library for converting Markdown → JSON/YAML/TOML/XML
homepage
repositoryhttps://github.com/jenul-ferdinand/md2data
max_upload_size
id1959533
size55,032
Jenul Ferdinand (jenul-ferdinand)

documentation

README

md2data for Rust 📦🦀

Markdown → JSON/YAML/TOML/XML. Faster with Rust.

Installation

Add to your Cargo.toml:

[dependencies]
md2data = "0.1"

Or use cargo add:

cargo add md2data

Features

By default, only JSON support is enabled. Enable other formats as needed:

[dependencies]
md2data = { version = "0.1", features = ["yaml", "toml", "xml"] }

Usage

use md2data::{convert_str, OutputFormat, ParsingMode};

fn main() {
    let markdown = r#"# Hello World

This is a **markdown** document."#;

    // Convert to different formats
    let json = convert_str(markdown, OutputFormat::Json, ParsingMode::Minified).unwrap();
    let yaml = convert_str(markdown, OutputFormat::Yaml, ParsingMode::Minified).unwrap();
    let toml = convert_str(markdown, OutputFormat::Toml, ParsingMode::Minified).unwrap();
    let xml = convert_str(markdown, OutputFormat::Xml, ParsingMode::Minified).unwrap();

    println!("{}", json);
}

Parsing Modes

  • ParsingMode::Minified (default): Compact representation
  • ParsingMode::Document: Full document structure with detailed node information

Developers: Build process

The build process can be initiated with cargo build.

Commit count: 0

cargo fmt