onlyafly / number-headings-obsidian

Automatically number headings in a document in Obsidian
MIT License
104 stars 11 forks source link

Is it possible to add both the "skipped " and "toc" attributes to a single heading? #55

Open kickTiger opened 9 months ago

kickTiger commented 9 months ago

Thank you for the update. I've already downloaded and tried the latest 1.16.0 update. The features are fantastic, especially the skip and table of contents generation functions.

Is it possible to add both the "skipped" and "toc" attributes to a single heading?

After testing, I have a question: Is it possible to add both the "skipped " and "toc" attributes to a single heading?

This is because if I want this heading to serve as a table of contents title, I might prefer it not to be included in the numbering range but let other content continue numbering while this table of contents title stands out.

I tried adding "^skipped ^toc" after the heading

I tried adding "^skipped ^toc" after the heading and attempted to adjust their order, but it didn't seem to work. I'm not sure if I'm using the correct syntax, or if this feature is not supported.

## heading ^skipped ^toc
content

I would appreciate it if you could consider supporting the ability to use both placeholders after the same heading.

onlyafly commented 9 months ago

Interesting question. I'll look into it

wyjek commented 2 months ago

Hello,

I found a one-time workaround - specify the same attribute in both categories - e.g. typing "^toc" both as a "skip headings" anchor and "table of contents" anchor makes my ToC skipped from numbering and the ToC is inserted. Of course it is not a perfect solution, as now I can't use the "skip headings" feature anymore, but it will do for now in my document.

kickTiger commented 2 months ago

Hello,

I found a one-time workaround - specify the same attribute in both categories - e.g. typing "^toc" both as a "skip headings" anchor and "table of contents" anchor makes my ToC skipped from numbering and the ToC is inserted. Of course it is not a perfect solution, as now I can't use the "skip headings" feature anymore, but it will do for now in my document.

I've also considered a method:

  1. When entering automatic numbering in the YAML area, start from level 2 or 3 headings.
  2. Then, use level 1 headings for content that doesn't need to be included in the table of contents; thus, the skipped content won't be numbered when generating the table of contents.