Crates.io | markdown-ast |
lib.rs | markdown-ast |
version | 0.1.1 |
source | src |
created_at | 2024-06-19 17:50:33.214379 |
updated_at | 2024-06-19 22:04:49.380741 |
description | Markdown AST representation for document construction and transformation, based on pulldown-cmark. |
homepage | |
repository | https://github.com/ConnorGray/Markdown |
max_upload_size | |
id | 1277232 |
size | 64,328 |
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.
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())
]))
]);
./crates/markdown-ast
: source code for the
general-purpose markdown-ast
crate.
./paclets/Markdown/
: source code for the
ConnorGray/Markdown
paclet.
./crates/md2nb/
: source code for the
md2nb
command-line utility.
./crates/wolfram-markdown-link
: source
code for the LibraryLink library used by the Markdown paclet.
third-party/commonmark-spec/
: git submodule of the
commonmark-spec repository.
Used by the markdown-ast
conformance tests.
Licensed under either of
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
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.
See Development.md for instructions on how to perform common development tasks when contributing to this repository.