Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Suggestion: a way to ignore certain headings #26

Open
daughtkom opened this issue Jun 29, 2017 · 4 comments · May be fixed by #92
Open

Suggestion: a way to ignore certain headings #26

daughtkom opened this issue Jun 29, 2017 · 4 comments · May be fixed by #92

Comments

@daughtkom
Copy link

It would be nice to have some sort of way to ignore certain headers and omit them from the TOC. In my example below, the TOC is in the Contents section, so it doesn't really need to be included.

image

One idea might be to optionally ignore sections containing the TOC itself. Another might be some syntax similar to:

## Contents  <!-- TOC omit:true -->

It's not really a big deal, but would be nice.

@alanwalk
Copy link
Owner

Thank your for your advice, it's a good idea, i will add it when version 1.6.0~

@berezovskyi
Copy link

Would be great to have 1.6.0 released in the store! Thanks for implementing it!

@bflatmajor
Copy link

So 1.6.0 is not released yet?

@kachkaev
Copy link

kachkaev commented Feb 24, 2019

This feature seems to appear in the source code:

https://github.com/AlanWalk/markdown-toc/blob/c9cddf99543ca1eb40e17b46d5bd69bb330d8d07/src/extension.ts#L27

However, writing something like this does not work

## Table of Contents <!-- TOC ignore:true -->

<!-- TOC depthFrom:2 -->
...
<!-- /TOC -->

Seems like the because of #50, <!-- TOC ignore:true --> is interpreted as just <!-- TOC --> with some wrong parameters and the result becomes:

<!-- TOC -->
...
<!-- /TOC -->

(the header as well as anything between it and /TOC gets erased)

@alanwalk would you be happy to accept a PR and release a new version?

mcornella added a commit to mcornella/markdown-toc that referenced this issue Sep 23, 2020
@mcornella mcornella linked a pull request Sep 23, 2020 that will close this issue
mcornella added a commit to mcornella/markdown-toc that referenced this issue Nov 2, 2020
mcornella added a commit to mcornella/markdown-toc that referenced this issue Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants