mdBook
mdBook copied to clipboard
Markdown page table of contents
Expanding from the idea of @ishitatsuyuki, I think mdbook should have the option to have a right-hand sidebar with a table of contents for a page.
Screenshot example
Examples of similar documents:
- https://redux.js.org/introduction/learning-resources
- https://docusaurus.io/docs/en/installation
- https://code.visualstudio.com/docs/editor/codebasics
This could be implemented as an option in the book.toml
file, or could be a YAML front matter setting at the top of a page, such as:
---
toc: true
---
Page content here...
For anyone still reading this (@aidan-fitz @tshepang @maniyar1), I've made a temporary workaround here.
Thanks @JorelAli 👍
I've used the CSS/JS you wrote and put it in a Userscript here (to be run by the browser). This way we can have a page ToC on deployed mdBooks that do not have one yet.
Hopefully this is somewhat useful :)
Come across this issue when I tried to find a solution for in-page tocs. This is such a great job and I wonder why not file a PR to merge this into mdbook's main stream so that everyone can use this feature out-of-box?
wow, this is exactly what I need, I spent a lot of time looking for it, I really look forward to merging it into mdbook soon. Pleeeeeaaaaase!!! It will save users a lot of time out of the box. Big thanks!!!