johansatge / obsidian-automatic-table-of-contents

💠 An Obsidian plugin to create a table of contents in a note, that updates itself when the note changes
MIT License
128 stars 12 forks source link

Exclude or ignore specific headings by text #46

Open kriskhaira opened 2 months ago

kriskhaira commented 2 months ago

Hi. It would be useful to be able to exclude a specific heading by text. The ideal API would be as follows (the last line):

style: nestedList
exclude: ["Contents", "References"]

This would then hide only the subheadings called "Contents" and "References" from the rendered TOC. An alternative syntax would be to use regex.

For a real-world example of how this would work in other systems, check out Confluence's Table of Contents macro (screenshot below).

Image of Confluence' Table of Contents' exclude headings feature