Can the TOC be integrated in the sidebar contents? #5859
-
DescriptionI am preparing a book project for a course. Quarto is awesome for this! The default HTML layout shows the list of chapters in the sidebar (left) and a TOC "On this page" relative to the present page in the margin (right). Is there an option to have the TOC integrated within the sidebar? I mean that the relevant chapter entry in the sidebar would expand, showing all TOC sections. Here is a sort of visual explanation: I have managed to move the TOC to the sidebar with the option I searched for other questions on this and found this one to be somewhat related, but it isn't the same. Just to justify this question: I personally find it logically neater if the left sidebar is dedicated to navigation- and site-related items, and the right margin only shows additional information related to the main, central text, such as margin notes, small plots, references, and similar. I'm really grateful that Quarto allows for this look out of the box! Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
Currently we don't have a way to include the TOC as additional sub items in the sidebar (the sidebar is currently reserved for top level elements (e.g. pages, chapters, parts). It would be a little complicated since the TOC is really only known for a page once it is rendered and the headings are identified, but it is something we could consider for a future release... Is it your preference in terms of layout appearance or is there some other use case driving this? |
Beta Was this translation helpful? Give feedback.
-
I would also prefer such behaviours. Coming from bookdown, I was immediately searching how to get the navigation in the sidebar. |
Beta Was this translation helpful? Give feedback.
-
I’m really hoping for this functionality as well. I want the TOC on the left to be for the whole book, like it was with the gitbook theme in bookdown. To the end user this is a book, not a collection of pages. It shouldn’t require navigating to a chapter to see what the sections are. I realize I could manually create the book’s complete TOC in the sidebar, but it feels like this should just be an option in the Yaml. |
Beta Was this translation helpful? Give feedback.
-
I just realized this was not a feature request, so upvoting and discussing here doesn’t accomplish anything. For those that are interested, I just made a feature request that you can upvote: #13392 |
Beta Was this translation helpful? Give feedback.
Currently we don't have a way to include the TOC as additional sub items in the sidebar (the sidebar is currently reserved for top level elements (e.g. pages, chapters, parts). It would be a little complicated since the TOC is really only known for a page once it is rendered and the headings are identified, but it is something we could consider for a future release...
Is it your preference in terms of layout appearance or is there some other use case driving this?