TOML frontmatter parser.
https://crates.io/crates/toml-frontmatter
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
9 months ago | |
---|---|---|
source | 9 months ago | |
tests | 9 months ago | |
.gitignore | 9 months ago | |
Cargo.toml | 9 months ago | |
LICENSE-Apache | 9 months ago | |
LICENSE-MIT | 9 months ago | |
Makefile.toml | 9 months ago | |
README.md | 9 months ago | |
rustfmt.toml | 9 months ago |
README.md
toml-frontmatter
TOML frontmatter parser.
API
For documentation see docs.rs.
Example
#[derive(serde::Deserialize)]
struct Frontmatter {
date: String,
}
let sample = r#"
---toml
date = "2023-01-01"
---
Some **Markdown**. Or something else!
"#.trim();
let (frontmatter, markdown) = toml_frontmatter::parse::<Frontmatter>(sample).unwrap();
License
Distributed under the Apache License 2.0 and MIT licenses, see LICENSE-Apache and LICENSE-MIT for more information.