Open JorelAli opened 4 years ago
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!!!
It would be nice if the solution to this didn't involve JS because that just offloads the needed changes in mdbooks source to end-users (doc readers) on page load.
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
![image](https://user-images.githubusercontent.com/4613171/85430460-0c94c200-b578-11ea-8c28-81d10ddbe0ec.png)Examples of similar documents:
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: