Crates.io | toml-frontmatter |
lib.rs | toml-frontmatter |
version | 0.1.0 |
source | src |
created_at | 2023-01-06 13:06:36.348506 |
updated_at | 2023-01-06 13:06:36.348506 |
description | TOML frontmatter parser. |
homepage | |
repository | https://git.bauke.xyz/Holllo/toml-frontmatter |
max_upload_size | |
id | 752291 |
size | 18,448 |
TOML frontmatter parser.
For documentation see docs.rs.
#[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();
Distributed under the Apache License 2.0 and MIT licenses, see LICENSE-Apache and LICENSE-MIT for more information.