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

Customize which header levels show up in TOC #5734

Open
lzdanski opened this issue Jan 23, 2025 · 0 comments
Open

Customize which header levels show up in TOC #5734

lzdanski opened this issue Jan 23, 2025 · 0 comments
Labels
feature Requests for new features. product/docs Fern Docs which builds and hosts a developer documentation site

Comments

@lzdanski
Copy link

Feature Description

Add front-matter parameters that allow a user to define the minimum or maximum header level to include in the auto-generated TOC for Docs pages.

Use Case

We have some pages that are very long or detailed, such as our Release notes. We still need to have headers, but we only want to show H1.

This feature can also create a work-around for any TOC problems resulting from header use in tabs.

Proposed Experience (Optional)

Add user-defined parameters to page front matter options:

  • toc_max_heading_level:
  • toc_min_heading_level:

Typically, there's a limit to how many header levels appear in TOC, which isn't necessarily a bad thing, however for certain types of long reference pages, it can create a bad navigation experience.

Alternatives Considered (Optional)

In a pinch, we remove the header formatting and instead Bold the text, then drop a manual anchor link in it. It's not really an alternative so much as an ugly workaround, but it does the job.

@lzdanski lzdanski added feature Requests for new features. product/docs Fern Docs which builds and hosts a developer documentation site labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Requests for new features. product/docs Fern Docs which builds and hosts a developer documentation site
Development

No branches or pull requests

1 participant