A preprocessor and cli tool for mdbook to auto generate summary.
bash
cargo install mdbook-auto-gen-summary
It can be use in two ways:
```bash mdbook-auto-gen-summary gen /path/to/your/mdbook/src
or
mdbook-auto-gen-summary gen -t /path/to/your/mdbook/src # -t indicate mdbook to make the first line(default the file name) of markdown file as the link text in SUMMARY.md ```
This will walk your mdbook src dir and generate the book summary in /path/to/your/mdbook/src/SUMMARY.md
```bash
[book] authors = [] language = "en" multilingual = false src = "src"
[build] create-missing = false
[preprocessor.auto-gen-summary] first-line-as-link-text = true # indicate mdbook to make the first line(default the file name) of markdown file as the link text in SUMMARY.md
[output.html.fold] enable = true level = 0
```
When you run
bash
mdbook serve
Or
bash
mdbook build
this will also walk your mdbook src dir and generate the book summary in /path/to/your/mdbook/src/SUMMARY.md