hipstersmoothie / obsidian-plugin-toc

Create a tables of contents for a note.
286 stars 20 forks source link

Exclude specific headings from the ToC #38

Open lougreenwood opened 1 year ago

lougreenwood commented 1 year ago

If I have one or more sub headings which I wish to exclude from a specific ToC is there some way to define a specific heading which should not be included the next time I generate the ToC?

ModEraNoah commented 10 months ago

Do you mean a specific heading level (range), e.g. only layer 1-x or would you like to exclude a heading (no matter which layer) from the ToC, e.g. # I'm a big Heading ## Me too! (## Please exclude me) ## Another heading in layer 2 ### Something ?

======================================================== updated comment because I positioned the quotation marks in the wrong place

kriskhaira commented 2 months ago

Hi. Anyone figured out how to do this?

To answer the previous post — excluding a heading (no matter which layer).

ModEraNoah commented 2 months ago

@kriskhaira I assume one could implement a simple search list and when creating the header-list, the current heading would need to be cross-checked with the search list... I think, a "simple" check inside of the createToc function of the src/create-toc.ts file would do the job