-
Notifications
You must be signed in to change notification settings - Fork 34
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
How can I omit a heading from TOC? #65
Comments
You can't exclude a single heading. You can only exclude all headings of a type, for example, all h1:
I do not plan to add support to exclude specific headings, because it's kinda weird. Markdown has no concept of a querySelector. The source document is Markdown, not HTML. You can't easily specify which headline you want to exclude. If you want more fine-grained control, I recommend to move the TOC generation to the client by using my client-side web component: https://github.com/cmaas/table-of-contents-element This way, you have full access to the DOM and can pass a querySelector as an attribute to exclude headings with a certain ID, class etc. |
@cmaas In VSCode, the EG: Some main titleEveryone can agree that's kind of awkward to get scrolled to above the TOC. |
Good idea, I added this as you suggested in the just released version 0.9.0 |
For example, it doesn't make sense to include the first h1 since it's always at the top of the page
The text was updated successfully, but these errors were encountered: