mdbook-pagetoc

namemdbook-pagetoc
created_at2022-04-05 17:09:53.136578
updated_at2023-12-30 19:22:40.675297
downloads6463
descriptionA mdbook plugin that provides a table of contents for each page.
homepagehttps://github.com/slowsage/mdbook-pagetoc
repositoryhttps://github.com/slowsage/mdbook-pagetoc
max_upload_size
id562696

documentation

https://github.com/slowsage/mdbook-pagetoc

readme

# mdbook-pagetoc A mdbook plugin that provides a table of contents for each page. Uses css/js from [mdBook-pagetoc](https://github.com/JorelAli/mdBook-pagetoc). ## Show me Sample image from [mdBook-pagetoc](https://github.com/JorelAli/mdBook-pagetoc): ![](https://raw.githubusercontent.com/JorelAli/mdBook-pagetoc/master/sample.png) ## Notes: - Only supports the `html` renderer. - On the first run of `mdbook build`, it creates three files `index.hbs`, `pagetoc.css` and `pagetoc.js`. - You can customize any of them after the first run. ## Configuration: - Add to `book.toml` config: ```toml [preprocessor.pagetoc] [output.html] additional-css = ["theme/pagetoc.css"] additional-js = ["theme/pagetoc.js"] ``` - If using a custom `index.hbs`, the place marker `
` can be inserted manually inside the `
` tag. ie. Replace ```hbs
{{{ content }}}
``` with: ```hbs
{{{ content }}}
``` - If not customizing, you may want to add entries as appropriate to `.gitignore` to keep your repo clean: ```gitignore theme/index.hbs theme/pagetoc.css theme/pagetoc.js ``` - Customization: To autohide when only single header, add this snippet to `pagetoc.css`: ```css a[class^='pagetoc-H']:only-child { display: none; } ``` ----- ## Acknowledgments - [mdBook-pagetoc](https://github.com/JorelAli/mdBook-pagetoc) ## Alternative - [mdbook-theme](https://github.com/zjp-CN/mdbook-theme)
Commit count: 17

cargo fmt