gnolang / docs.gno.land

Miscellaneous files for gno.land documentation
https://docs.gno.land
1 stars 4 forks source link

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

Open leohhhn opened 1 month ago

leohhhn commented 1 month ago

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?

alexiscolin commented 1 month ago

@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.