1
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Bauke 6ec6e77b92
Parse also errors when TOML parsing fails.
4 weeks ago
source Parse also errors when TOML parsing fails. 4 weeks ago
tests Add source and test files. 1 month ago
.gitignore Add project files. 1 month ago
Cargo.toml Version 0.1.0! 1 month ago
LICENSE-Apache Add license files. 1 month ago
LICENSE-MIT Add license files. 1 month ago
Makefile.toml Add project files. 1 month ago
README.md Add project files. 1 month ago
rustfmt.toml Add project files. 1 month 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.