1
Fork 0
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.
Bauke 6ec6e77b92
Parse also errors when TOML parsing fails.
5 months ago
source Parse also errors when TOML parsing fails. 5 months ago
tests Add source and test files. 5 months ago
.gitignore Add project files. 5 months ago
Cargo.toml Version 0.1.0! 5 months ago
LICENSE-Apache Add license files. 5 months ago
LICENSE-MIT Add license files. 5 months ago
Makefile.toml Add project files. 5 months ago
README.md Add project files. 5 months ago
rustfmt.toml Add project files. 5 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.