1
Fork 0
Go to file
Bauke e5dd90547f
Update dependencies and fix Deserialize lifetime.
2024-02-01 13:20:52 +01:00
source Update dependencies and fix Deserialize lifetime. 2024-02-01 13:20:52 +01:00
tests Add source and test files. 2023-01-06 14:03:43 +01:00
.envrc Add Nix flake and direnv files. 2024-02-01 13:16:43 +01:00
.gitignore Add Nix flake and direnv files. 2024-02-01 13:16:43 +01:00
Cargo.toml Update dependencies and fix Deserialize lifetime. 2024-02-01 13:20:52 +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 Nix flake and direnv files. 2024-02-01 13:16:43 +01:00
README.md Add project files. 2023-01-06 14:02:21 +01:00
flake.lock Add Nix flake and direnv files. 2024-02-01 13:16:43 +01:00
flake.nix Add Nix flake and direnv files. 2024-02-01 13:16:43 +01:00
rustfmt.toml Add project files. 2023-01-06 14:02:21 +01:00
rustup-toolchain.toml Add Nix flake and direnv files. 2024-02-01 13:16:43 +01:00
shell.nix Add Nix flake and direnv files. 2024-02-01 13:16:43 +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.