mdbook-frontmatter-strip

Crates.iomdbook-frontmatter-strip
lib.rsmdbook-frontmatter-strip
version1.0.0
created_at2025-11-25 19:21:36.541218+00
updated_at2025-12-09 17:34:04.497034+00
descriptionmdBook preprocessor that strips YAML frontmatter from chapters
homepage
repositoryhttps://github.com/saylesss88/mdbook-frontmatter-strip
max_upload_size
id1950320
size29,256
T. Sawyer (saylesss88)

documentation

README

mdbook-frontmatter-strip

An mdBook preprocessor that strips YAML frontmatter from chapters before they are rendered, so metadata like title, date, or tags does not appear in the generated HTML.


Installation

cargo install mdbook-frontmatter-strip

Check your version:

mdbook-frontmatter-strip --version

mdbook-frontmatter-strip must be on your PATH so that mdbook can discover and run it.

Tested with:

  • mdbook v0.5.1

  • Rust editions 2020 & 2024

Usage

Add the preprocessor to your book.toml:

[preprocessor.frontmatter-strip]
renderers = ["html"]

Then build as usual:

mdbook build

Behavior

  • Supports fenced --- YAML frontmatter at the top.

  • Supports unfenced YAML only when there are at least 2 consecutive key: value lines.

  • URLs like http://example.com at the top are not treated as frontmatter.

This crate includes integration tests that exercise fenced and unfenced frontmatter stripping, nested chapters, and common edge cases (like top-level URLs), to keep the behavior stable across mdBook updates.


License

Apache License 2.0

Commit count: 0

cargo fmt