#mdbook #preprocessor #content #subdirectory #table #generate

app mdbook-readme-summary

A mdbook Preprocessor that generates table for content for each subdirectory README files

2 stable releases

1.1.1 May 15, 2023
1.1.0 May 14, 2023

#1747 in Text processing

36 downloads per month

MIT/Apache

18KB
160 lines

mdbook-readme-summary

Usecase

When you are using mdbook and you have the following file structure:

. └── src/ ├── subdirectory1/ │ ├── subdirectory1.1/ │ │ ├── file1.md │ │ ├── ... │ │ └── README.md │ ├── file1.md │ ├── file2.md │ ├── ... │ └── README.md ├── subdirectory2/ │ ├── file1.md │ ├── file2.md │ ├── ... │ └── README.md ├── ... └── README.md

and you want a table of content within the readme in each subdirectory showing the content of that directory.

Usage

run

cargo install mdbook-readme-summary

In your README.md files, add {{TOC}} in a desired location.

In your book.toml add

[preprocessor.readme-summary]

There are two configuration that you can use:

[preprocessor.readme-summary]
enable-draft = true
enable-log = true

This preprocessor automatically ignore files and directories that names containing the keyword "(draft)" by default.Setting enable-draft to true will disable that ignore.

Setting enable-log to true will show some logging information to debugging.

Dependencies

~12–24MB
~331K SLoC