There are many instances where it doesn't make sense to generate and show a Table of Contents, such as when there are only one or two (or even three!) sub-headers, however it would still be useful to have header IDs generated so that we can link directly to those sections in the KB Article.
Presently, the header ID-generation is only in effect when toc-enable: on. It would be nice to generate those header IDs even when toc-enable: off.
Next Actions
[x] Refactor this class. It would be nice to make a separate class file that deals with ID generation so that it can be applied without the generation of a TOC.
[x] Add a new option that controls the generation of heading IDs. A default value will go into the WPKBA UI, and then it should be configurable from the YAML config. file also. The default (default), will be true. The YAML config. key name will be: hids-enable: true|false. If toc-enable: true, then hids-enable: is forced to a true value, since TOC generation depends on heading IDs.
[x] Make TOC generation a separate layer of functionality that uses the refactored class members, but with the existing configuration options; i.e., toc-enable: true|false.
Take the refactored class and make heading IDs and TOC generation an option in the s2Clean theme also. This way it becomes possible to auto-generate heading IDs and/or a TOC in other parts of the site too; even if you don't have WPKBA installed; i.e., make this an s2Clean feature. Moving to https://github.com/websharks/s2clean/issues/27
There are many instances where it doesn't make sense to generate and show a Table of Contents, such as when there are only one or two (or even three!) sub-headers, however it would still be useful to have header IDs generated so that we can link directly to those sections in the KB Article.
Presently, the header ID-generation is only in effect when
toc-enable: on
. It would be nice to generate those header IDs even whentoc-enable: off
.Next Actions
true
. The YAML config. key name will be:hids-enable: true|false
. Iftoc-enable: true
, thenhids-enable:
is forced to a true value, since TOC generation depends on heading IDs.toc-enable: true|false
.Take the refactored class and make heading IDs and TOC generation an option in the s2Clean theme also. This way it becomes possible to auto-generate heading IDs and/or a TOC in other parts of the site too; even if you don't have WPKBA installed; i.e., make this an s2Clean feature.Moving to https://github.com/websharks/s2clean/issues/27