1
Fork 0
Go to file
Bauke 5f292fedcc
Version 0.1.0!
2023-01-06 14:05:47 +01:00
source Add source and test files. 2023-01-06 14:03:43 +01:00
tests Add source and test files. 2023-01-06 14:03:43 +01:00
.gitignore Add project files. 2023-01-06 14:02:21 +01:00
Cargo.toml Version 0.1.0! 2023-01-06 14:05:47 +01:00
LICENSE-Apache Add license files. 2023-01-06 13:58:11 +01:00
LICENSE-MIT Add license files. 2023-01-06 13:58:11 +01:00
Makefile.toml Add project files. 2023-01-06 14:02:21 +01:00
README.md Add project files. 2023-01-06 14:02:21 +01:00
rustfmt.toml Add project files. 2023-01-06 14:02:21 +01:00

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.