ndabas / toc

Table of Contents jQuery Plugin - A minimal, tiny jQuery plugin that will generate a table of contents, drawing from headings on the page.
https://ndabas.github.io/toc/
Apache License 2.0
84 stars 24 forks source link

feature: add headings numbering #12

Closed bodik closed 6 years ago

bodik commented 6 years ago

feature will add headings numbering for better orientation on the page and TOC

ndabas commented 6 years ago

Thank you for your effort; however, I will not merge this PR because toc is supposed to be minimal, and the feature you want can be implemented using just CSS, no JS needed.

There is an example in this answer on StackOverflow.

bodik commented 6 years ago

ok thanks for reply, but note that adding numbering is done to the actual headings too and that cannot be done without JS.

ndabas commented 6 years ago

If you're adding numbers to the headings -- that should be a separate plugin anyway because doing that is not in the scope of a TOC-generation plugin.

I believe it should be possible to achieve that as well using just CSS, as CSS counters are not tied to lists or list items, and can be used with any element.

bodik commented 6 years ago

sounds very reasonable, thank you for your time