An mdbook preprocessor that generates tag index pages from frontmatter metadata.
- Scans markdown files for
tagsin YAML frontmatter - Generates
_tags/directory with per-tag index pages - Works as both mdbook preprocessor and standalone CLI
---
tags: [rust, wasm, tutorial]
---Or multiline:
---
tags:
- rust
- wasm
- tutorial
---# Generate tag pages for a book
mdbook-tagging generate ./my-bookAdd to book.toml:
[preprocessor.tagger]
command = "mdbook-tagging preprocess"Then run mdbook build as usual.
For each unique tag, a page is created at _tags/<tag>.md listing all articles with that tag.
Example _tags/rust.md:
# Tag: rust
- [Introduction](../chapters/intro.md)
- [Rust Basics](../chapters/rust-basics.md)A _tags/SUMMARY.md index page is also generated:
# Tags
| Tag | 文章数 |
|-----|--------|
| [rust](rust.md) | 2 |
| [wasm](wasm.md) | 1 |cargo build --releaseMIT