1
Fork 0
mdbook-toc/README.md

41 lines
662 B
Markdown
Raw Normal View History

2018-07-20 10:07:21 +00:00
# mdbook-toc
2019-07-10 19:22:50 +00:00
A preprocessor for [mdbook][] to add inline Table of Contents support.
2018-07-20 10:07:21 +00:00
[mdbook]: https://github.com/rust-lang-nursery/mdBook
It turns this:
```
<!-- toc -->
```
into a Table of Contents based on all top- and second-level headings of the chapter.
## Installation
If you want to use only this preprocessor, install the tool:
```
2019-07-10 19:15:33 +00:00
cargo install mdbook-toc
2018-07-20 10:07:21 +00:00
```
2019-07-10 19:15:33 +00:00
Add it as a preprocessor to your `book.toml`:
2018-07-20 10:07:21 +00:00
```
2019-07-10 19:15:33 +00:00
[preprocessor.toc]
command = "mdbook-toc"
renderer = ["html"]
2018-07-20 10:07:21 +00:00
```
2019-07-10 19:15:33 +00:00
Finally, build your book as normal:
2018-07-20 10:07:21 +00:00
```
2019-07-10 19:15:33 +00:00
mdbook path/to/book
2018-07-20 10:07:21 +00:00
```
## License
MPL. See [LICENSE](LICENSE).
Copyright (c) 2018 Jan-Erik Rediger <janerik@fnordig.de>