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

Add option to view headings up to H6 in the table of contents #1427

Merged
merged 6 commits into from
Sep 9, 2021

Conversation

fredericjacob
Copy link
Contributor

This PR adds the option to view headings up to H6 in the table of contents in view mode.

The original checkbox in the markdown settings allowed to choose between no table of contents (unchecked) and a table of contents with headings up to H3 (checked).
With these changes, the checkbox is replaced with a radio button preference that allows to choose between no table of contents, a simple table of contents (like the existing, up to H3) and an "extended" table of contents with headings up to H6.

Background: I have quite a few files in my notebook with headings beyond H3 which I was missing in the view mode table of contents. I feel others might profit from more heading levels as well, while some may still prefer a smaller table of contents which shows only the topmost (presumably most relevant) heading levels up to H3.

grafik

grafik

Copy link
Owner

@gsantner gsantner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I suggest instead: To have checkboxes to toggle on/off all levels separately. If we add option to select none/23/2456, one comes up why there is no 1, or they don't want 6.

@gsantner gsantner marked this pull request as draft September 9, 2021 20:34
@fredericjacob
Copy link
Contributor Author

@gsantner That's a good point - I changed the setting accordingly. Now it's possible to toggle each heading level separately:

H1 to H3:
grafik
grafik

H2, H5, H6:
grafik
grafik

No table of contents:
grafik
grafik

@gsantner gsantner force-pushed the extended-table-of-contents branch from 822de45 to 663004c Compare September 9, 2021 22:58
@gsantner gsantner marked this pull request as ready for review September 9, 2021 22:58
@gsantner gsantner added this to the 2.9 milestone Sep 9, 2021
@gsantner gsantner merged commit 2005fa4 into gsantner:master Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants