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

Display non-empty page TOC #1147

Merged

Conversation

chalin
Copy link
Collaborator

@chalin chalin commented Aug 9, 2022

Proposes a solution to #853 along the lines of #853 (comment):

... show the TOC if and only if it is non-empty. If projects want to refine this behavior (by counting the number of TOC entries for example), they can override the template.

This is an alternative proposal to #1110 which doesn't rely on the (IMHO) faulty TOC character-count metric.

Preview:

So if y'all agree, this would be a step forward:

@chalin chalin requested review from LisaFC and geriom August 9, 2022 15:10
@chalin chalin mentioned this pull request Aug 9, 2022
@LisaFC
Copy link
Collaborator

LisaFC commented Aug 9, 2022

LGTM!

@LisaFC LisaFC merged commit f8e4409 into google:main Aug 11, 2022
@polarweasel
Copy link

Elegant solution. Thank you @chalin!

@chalin chalin deleted the chalin-mb-display-non-empty-toc-2022-08-09 branch August 11, 2022 21:54
fekete-robert pushed a commit to fekete-robert/docsy that referenced this pull request Sep 13, 2022
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.

Page TOC not showing up parameter to customize the length of toc
3 participants