markdown-it-front-matter.rs

crates.io

A markdown-it.rs plugin to process front matter containers.

Usage

```rust let parser = &mut markdownit::MarkdownIt::new(); markdownitfrontmatter::add(parser); let ast = parser.parse("---\nfoo: bar\n---\n");

print!("{:#?}", ast.children); // [ // Node { // children: [], // srcmap: Some( // ( // 0, // 16, // ), // ), // ext: NodeExtSet( // {}, // ), // attrs: [], // nodetype: markdownitfrontmatter::FrontMatter, // node_value: FrontMatter { // content: "foo: bar\n", // }, // }, // ] ```

Valid Front Matter

Essentially, valid front matter is a fenced block:

```yaml

valid-front-matter: true

```