Skip to content
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

Styling: Add summary support for H4, H5, H6 #43

Open
leohhhn opened this issue Jun 7, 2024 · 1 comment
Open

Styling: Add summary support for H4, H5, H6 #43

leohhhn opened this issue Jun 7, 2024 · 1 comment

Comments

@leohhhn
Copy link
Contributor

leohhhn commented Jun 7, 2024

Description

I've found myself multiple times in the situation where I can use H4, H5 and H6 headers, and have them show up in the sidebar correctly. This is mainly used for a good document summary and subpages. Currently the summary on the right side only shows up to H3 headers.
Screenshot 2024-06-07 at 22 17 45

In the above example, auth/accounts is H4.

@alexiscolin What do you think? The segmentation that you can get with more headers is definitely useful, but I am concerned if the summary on the right side of a page in docusaurus might get too cramped with this. Do you have any other suggestion which might be better?

@leohhhn leohhhn changed the title Styling: Add support for H4, H5, H6 Styling: Add summary support for H4, H5, H6 Jun 7, 2024
@alexiscolin
Copy link
Member

@leohhhn We can easily add new levels of title to be generated into the ToC. It may be a global config. But if you are concerned about the fact that may be too much, I mean, some pages might need a H1-H5 content and other would be too cramped and you might prefer a H1-H4 content to be generated. For those one, you can locally (in markdown front-matter) add a designated option to override default config:

---
# Display h2 to h5 headings
toc_min_heading_level: 2
toc_max_heading_level: 5
---

Finally, another radical choice would be to replace the ToC component by a new one (handmade) with specific option (we might think about a dropdown component inside the ToC) but it would require more time to develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants