-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In-page Table of contents (For all headings) #1523
Comments
@Michael-F-Bryan @budziq @steveklabnik @frewsxcv ("If we don't respond in a couple of days, ping us |
Note that there's a bolt-on solution to this feature via https://github.com/JorelAli/mdBook-pagetoc. But I too would love to see this available as a native option. 🙂 |
Thank you @anoadragon453 for the link. In fact, I just found out that #153 (Add [TOC] support) is a similar feature request which has been solved with another repo (mdbook-preprocessor) which can be found over here - badboy/mdbook-toc. This also means that #153 can be closed (@Michael-F-Bryan , @budziq , @steveklabnik , @frewsxcv ) Another feature request can be found here: #1263 opened by @JorelAli (Thank you for the solution!) which may now be closed. Also, should this feature request be closed now, or should I leave it open so that this feature gets natively implemented? Maybe, in my spare time, I could try to integrate @JorelAli's solution into It seems like this is a popular feature request coming up multiple times over the years (#58 #153 #1263 #1523). Maybe it's time to implement/integrate it. Thank you. |
Published a new preprocessor crate mdbook-pagetoc to wrap the solution by @JorelAli. Steps:
Thank you @JorelAli! |
Vote for this! This is especially useful for long pages Here's a link to Qt docs which made this right. |
rust-lang/mdBook#1523 (comment) cargo install mdbook-pagetoc
What might be a neat solution would be to a combination of this and I think that would be a neat solution and middle-ground between both features, as the table of contents will be there as well on the print versions, but will be moved to a sidebar if viewed in a browser. |
ISSUE
This issue (or a similar one) was raised 5 years ago over here.
I want to make it clearer as to exactly what I would love for to be added as a feature as it would be a great interface.
In today's documentation websites, nearly ALL sites have a TOC (table of contents) to the Right-Hand-Side of the page (and sometime to the left), which list all the
Headings
of the page (i.e.h1
,h2
,h3
, ...) for easier in-page navigation as shown below: (the image is from this site)Usefulness
It is useful since sometimes you CANNOT divide that page into sub-sections within the MAIN TOC because it doesn't make sense. For example, in a single page we have an explanation of a concept that has a number of sections that make sense only on a single page, then the page might get a bit long, but not long enough to justify splitting it into multiple pages, which requires extensive scrolling to get from one part of the page to another. A simple example
Implementation ideas
I am suggesting that a similar feature be added to this repo:
There are a number of design ideas (I obtained from other sites):
Original page
This is the ORIGINAL:
top bar
(which makes more sense anyway, since they aren't used too frequently, in my experience), so we now have more screen spaceh1
shown and they can further be expanded to showh2
and they can be expanded to showh3
and so on...page TOC
on and off.modified page 1
This is a mock UI (not really good looking):
modified page 2
We can further make sure that the left and right page navigation button make more sense by changing the title of the page from the book to that of the page and moving the title of the book into the sidebar (
main TOC
) as shown in figure below:These are just suggestions as to the proposed UI. I highly recommend checking out This page and This page to understand the complete experience. I thank this team for considering this feature in advance. I think I followed all guideline
The text was updated successfully, but these errors were encountered: