1
Fork 0
Find a file
2019-07-10 15:20:16 +02:00
ci Run tests during CI 2019-07-10 14:52:14 +02:00
src Fix test by expecting one more newline 2019-07-10 15:20:16 +02:00
.gitignore init 2018-07-19 18:10:08 +02:00
.travis.yml Let Travis and AppVeyor deploy new releases 2019-07-10 14:14:59 +02:00
appveyor.yml Run tests during CI 2019-07-10 14:52:14 +02:00
Cargo.lock Update dependencies and refactor mdbook-toc into a preprocessor 2019-07-09 11:15:10 +02:00
Cargo.toml Update dependencies and refactor mdbook-toc into a preprocessor 2019-07-09 11:15:10 +02:00
LICENSE Add License and Readme 2018-07-20 12:07:21 +02:00
README.md Add License and Readme 2018-07-20 12:07:21 +02:00

mdbook-toc

A preprocessor for mdbook to add inline Table of Content support.

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:

cargo install --git https://github.com/badboy/mdbook-toc

Finally, build your book:

mdbook-toc path/to/book

Programmatic use

You can also use this programmatically, e.g. in order to use multiple additional preprocessors. Add mdbook-toc as a dependency in your Cargo.toml:

[dependencies.mdbook-toc]
git = "https://github.com/badboy/mdbook-toc"

Then add it to your code:

extern crate mdbook_toc;

// ...

let mut book = MDBook::load(&book_dir)?;
book.with_preprecessor(mdbook_toc::Toc);

License

MPL. See LICENSE.
Copyright (c) 2018 Jan-Erik Rediger janerik@fnordig.de