Replies: 2 comments 3 replies
-
|
It's hard for me to understand what you are trying to do exactly. Creating a mockup with https://excalidraw.com/ can help. Note we made sidebars "lazy" on the server so sidebars are not fully server-rendered for perf reasons (#5136) Eventually you can try to swizzle this comp and remove the lazy collapsible option to get it rendered statically: If this make sense and you can achieve what you want, we could add an official option to disable this lazy sidebar item behavior for certain use-cases when you really need the whole sidebars to be server-rendererd. For print styles, you can provide your own CSS to to make them visible, and we shouldn't need to do anything about it. |
Beta Was this translation helpful? Give feedback.
-
|
Did you attempt to use the inline table of content? Does it resolve your needs? Additionally, for PDF generating, there is an open-source tool: |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'd like to get the all sidebar items programmatically and render it into the content of a page.
My use case is to print the table of contents (ToC) for the whole site into PDF.
But the current sidebar doesn't work because not all sidebar items are expanded. Some of our docs in sidebar are collapsed by default. Only when a user click on the top-level category item then Docusaurus can render items with that category. This prevent us from generate the whole ToC programmatically.
Also items in sidebars are hidden by default with print styles. So I'd like to know if there's an easy method to get all sidebar items then render them in to a specific statically.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions