Ability to exclude headings from TOC
See original GitHub issueI am migrating from using Kramdown, and wondered if there is functionality to exclude headers from the TOC?
In Kramdown…
# Header 1
## Header 2
{:.no_toc}
## Header 3
Would result in just creating the TOC with “Header 1” and “Header 3”, excluding “Header 2” from the list.
Reference: https://kramdown.gettalong.org/converter/html.html#toc
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Removing Heading References in Table of Contents
I'd like to remove the references to some headings in a Table of Contents so they no longer appear in the Table, without...
Read more >How to Exclude Headings from the Table of Contents?
1. Go to the settings for the Row, Column, or Widget that you want to exclude from the Table of Contents. In settings,...
Read more >Exclude Headings feature on Table of Contents macro is not ...
The TOC macro offers the ability to exclude headings from the report. According to the macro's documentation: Filter headings to exclude according to ......
Read more >Exclude heading from toc globally · Issue #723 - GitHub
I want to exclude the heading "# On this page" from my workspace toc globally. I reviewed the instructions and it seems it...
Read more >Word - Excluding a part of a heading from the Table of Contents
The primary reason to do this is when you want a snippet from the beginning of a particular heading to appear in a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The issue is still relevant.
One workaround I’ve found is to define headers with html tags, e.g .
<h2>My header</h2>instead of## My header. This way, it won’t be included in ToC. However, it would also be ignored by other plugins.I wish there was a way to ignore a Markdown-defined header specifically by this plugin.
Looking exactly for this. It would be nice to exclude specific headers from the TOC, as kramdown does.
Maybe exclude them based on their class. Actually, it could go both ways: exclude if “no_toc” or include if “toc”.
No need to use
markdown-it-kramdown-attrs, but possible.