I tried to use it today to replace some in-house code that generated TOCs client-side. The issue I run into was that we are also adding sections with headings in the same template, which of course are not reflected in the TOC as they are not part of content. It would be nice to be able to add TOC items for these manually.
One possible API for this would be to deprecate the ul option and replace it with a listElement option that takes values like ul or 'ol, but could also take the empty string for no list. Then the consumer of this plugin can add the <ol>/<ul> manually and prepend/append any additional items.
Thanks for making this plugin!
I tried to use it today to replace some in-house code that generated TOCs client-side. The issue I run into was that we are also adding sections with headings in the same template, which of course are not reflected in the TOC as they are not part of
content
. It would be nice to be able to add TOC items for these manually.One possible API for this would be to deprecate the
ul
option and replace it with alistElement
option that takes values likeul
or'ol
, but could also take the empty string for no list. Then the consumer of this plugin can add the<ol>
/<ul>
manually and prepend/append any additional items.