Exclude a single heading from TOC
Is there a way to exclude a single heading from the TOC?
I'd like to leave a heading at H2, but not have it appear in the table of contents. I could style around it, but it would be nice if there was an easy way to do this in the markdown file.
Example:
## one
## two (exclude from toc)
## three
## four
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 25 Jul, 2016 02:09 PM
This is too much of an edge case to be incorporated directly, but you
have a couple of options. Depending on what other header levels you're
using, you could simply style h3 or h4 to look like h2, then set the toc
to a max of 2. It would appear the same, but be excluded. You could also
create the whole TOC via custom script using something like Kramdown,
which has built in TOC capabilities and the ability to exclude headers
using {: x} directives.
-Brett