Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add option to hide an empty TOC #51

Open
Tholleman opened this issue Jul 16, 2024 · 1 comment
Open

Add option to hide an empty TOC #51

Tholleman opened this issue Jul 16, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Tholleman
Copy link

I've got the TOC in my template but don't like the look of the warning when there are no headings.
My proposed solution is a new option that hides the TOC in that case

```table-of-contents
hideWhenEmpty: true
```

which would hide the warning:
Table of contents: no headings found

@Tholleman Tholleman added the enhancement New feature or request label Jul 16, 2024
@Tholleman
Copy link
Author

Not entirely sure what should happen to the title in this case. I don't use it so I have no strong preference.
If "hideWhenEmpty" is the name of the option then it should also hide the title. If the option is instead named "hideWarning" then you should still render the title.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants