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

Expand H2 to display H3 in floating TOC #2474

Open
1 of 2 tasks
hillaryfraley opened this issue May 21, 2020 · 2 comments
Open
1 of 2 tasks

Expand H2 to display H3 in floating TOC #2474

hillaryfraley opened this issue May 21, 2020 · 2 comments
Labels
site development Improves docs.sensu.io functionality

Comments

@hillaryfraley
Copy link
Contributor

hillaryfraley commented May 21, 2020

Description

#2544 includes a change to add a floating TOC that lists all of the H2 headings on each page.

We would like to add functionality to the floating TOC so that when a user clicks on one of the H2 headings, that H2 heading expands in the TOC to list the H3 headings it contains.

Category

This is an issue with:

  • bug (bug in site build, layout, or functionality)
  • enhancement (add new or updated site functionality)

Affected pages

All

Expected behavior

The floating TOC lists all H2 headings on the page and when a user clicks one, it expands to list all the H3 headings it contains.

Current behavior

The floating TOC lists H2 headings on the page, but no H3 headings.

@hillaryfraley hillaryfraley added enhancement New or updated site functionality hold for now Not working now, but may in the future labels May 21, 2020
@hillaryfraley hillaryfraley added this to the 2020 Docs IA milestone May 21, 2020
@calebhailey calebhailey added the site development Improves docs.sensu.io functionality label Sep 23, 2021
@hillaryfraley hillaryfraley removed this from the Site development milestone Sep 23, 2021
@calebhailey calebhailey added this to the 6.6.0 milestone Sep 23, 2021
@portertech portertech modified the milestones: 6.6.0, 6.next Nov 22, 2021
@hillaryfraley hillaryfraley removed the hold for now Not working now, but may in the future label Nov 24, 2021
@hillaryfraley
Copy link
Contributor Author

It's possible to adjust this code in config.toml so that endLevel = 3

  [markup.tableOfContents]
    endLevel = 2
    ordered = false
    startLevel = 2

This will display the H3 headings in the floating TOC. However, there are a couple formatting problems to solve:

  • For some pages, including H3 headings makes the list of headings in the floating TOC too long to fit on the page. Scrolling with the mouse currently affects only the content part of the page -- you cannot scroll to the end of the floating TOC list without also scrolling to the bottom of the page. Need to decouple scrolling for the content and the floating TOC.
  • H2 and H3 headings are improperly spaced in the floating TOC. Need to revisit line spacing in the floating TOC to better communicate heading hierarchy at a glance.

@calebhailey calebhailey modified the milestones: 6.next, 6.7.0 Dec 23, 2021
@hillaryfraley hillaryfraley modified the milestones: 6.7.0, 6.next Jan 24, 2022
@hillaryfraley hillaryfraley removed the enhancement New or updated site functionality label Feb 1, 2022
@hillaryfraley hillaryfraley removed this from the 6.next milestone Feb 15, 2022
@hillaryfraley
Copy link
Contributor Author

If possible, it would be helpful to make the H3 optional in the floating TOC. For some pages, the H3 headings will just clutter the TOC without much navigation improvement. For example, the H3s in the API docs are identical within H2s, and H2 alone is probably more helpful because it removes the H3 clutter from the floating TOC. Other pages, like the RBAC reference, seem like they are so long that a floating TOC with H3s could become too long itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site development Improves docs.sensu.io functionality
Projects
None yet
Development

No branches or pull requests

3 participants