rushdown-meta
rushdown-meta is a simple meta(YAML frontmatter) plugin for rushdown, a markdown parser. It allows you to easily add metas to your markdown documents.
Installation
Add dependency to your Cargo.toml:
[]
= "x.y.z"
rushdown-meta can also be used in no_std environments. To enable this feature, add the following line to your Cargo.toml:
= { = "x.y.z", = false, = ["no-std"] }
Syntax
date: 2024-01-01
tags:
title: My Document
That's some text with a meta.
Usage
Example
use ;
use ;
let source = r#"---
title: YAML Frontmatter
---
aaa
"#;
let parser = with_extensions;
let renderer = with_extensions;
let mut reader = new;
let = parser.parse;
let metadata = as_kind_data!.metadata;
assert_eq!;
let mut output = Stringnew;
renderer
.render
.expect;
Metadata is stored in the Document node.
You can get the metadata from the Document using metadata() method.
Options
| Option | Type | Default | Description |
|---|---|---|---|
table |
bool |
false |
whether to render the meta as a table |
Donation
BTC: 1NEDSyUmo4SMTDP83JJQSWi1MvQUGGNMZB
Github sponsors also welcome.
License
MIT
Author
Yusuke Inuzuka