markdown-ast

Crates.iomarkdown-ast
lib.rsmarkdown-ast
version0.1.1
sourcesrc
created_at2024-06-19 17:50:33.214379
updated_at2024-06-19 22:04:49.380741
descriptionMarkdown AST representation for document construction and transformation, based on pulldown-cmark.
homepage
repositoryhttps://github.com/ConnorGray/Markdown
max_upload_size
id1277232
size64,328
Connor Gray (ConnorGray)

documentation

README

Markdown

API Documentation | Changelog | Contributing

This repository contains two projects for working with Markdown documents:

  • markdown-ast — a Rust crate modeling Markdown syntax as an AST.

  • ConnorGray/Markdown — a Wolfram paclet providing a symbolic representation of Markdown elements, and (TODO) notebook frontend support for opening and editing .md files.

Quick Examples

Parse a Markdown document into an AST in Rust:

use markdown_ast::{markdown_to_ast, Block, Inline, Inlines};

let ast = markdown_to_ast("
Hello! This is a paragraph **with bold text**.
");

assert_eq!(ast, vec![
    Block::Paragraph(Inlines(vec![
        Inline::Text("Hello! This is a paragraph ".to_owned()),
        Inline::Strong(Inlines(vec![
            Inline::Text("with bold text".to_owned()),
        ])),
        Inline::Text(".".to_owned())
    ]))
]);

File Overview

License

Licensed under either of

at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Developer Notes

See Development.md for instructions on how to perform common development tasks when contributing to this repository.

Commit count: 89

cargo fmt