Skip to content

wustites/mdbook-tagging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdbook-tagging

An mdbook preprocessor that generates tag index pages from frontmatter metadata.

Features

  • Scans markdown files for tags in YAML frontmatter
  • Generates _tags/ directory with per-tag index pages
  • Works as both mdbook preprocessor and standalone CLI

Frontmatter Format

---
tags: [rust, wasm, tutorial]
---

Or multiline:

---
tags:
  - rust
  - wasm
  - tutorial
---

Usage

Standalone CLI

# Generate tag pages for a book
mdbook-tagging generate ./my-book

As mdbook Preprocessor

Add to book.toml:

[preprocessor.tagger]
command = "mdbook-tagging preprocess"

Then run mdbook build as usual.

Generated Output

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 |

Build

cargo build --release

License

MIT

About

mdBook preprocessor for tag index pages from frontmatter

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages