TOML frontmatter parser.
https://crates.io/crates/toml-frontmatter
Bauke e5dd90547f | ||
---|---|---|
source | ||
tests | ||
.envrc | ||
.gitignore | ||
Cargo.toml | ||
LICENSE-Apache | ||
LICENSE-MIT | ||
Makefile.toml | ||
README.md | ||
flake.lock | ||
flake.nix | ||
rustfmt.toml | ||
rustup-toolchain.toml | ||
shell.nix |
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.