question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to exclude headings from TOC

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
vladfaustcommented, Aug 27, 2020

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.

0reactions
joapuiibcommented, Dec 9, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found