Packages / rupm

rs-data-frontmatter 0.1.0

Split a document into YAML or TOML front matter text and body using --- and +++ fences

Install

cargo add rs-data-frontmatter --registry rupm

In Ruststudio: Packages, search for rs-data-frontmatter, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.

Versions

README

# rs-data-frontmatter

Split a document into YAML or TOML front matter text and body using --- and +++ fences.

## Install

`rupm add rs-data-frontmatter` (or `cargo add rs-data-frontmatter --registry rupm`).

## Usage

```rust
let doc = rs_data_frontmatter::split("---\ntitle: Hi\n---\nBody");
assert_eq!(doc.front, Some("title: Hi"));
```

## API overview

- `split(&str) -> Document` with `format`, `front` and `body`.
- `Format::Yaml` for `---`, `Format::Toml` for `+++`.
- Documents without a closing fence have no front matter.