Kanka Automatic Table of Contents

Automatically adds a table of contents to Kanka entity pages under the Pins sidebar.

Skapare
Salvatos
Dagliga installationer
0
Totala installationer
27
Betyg
1 0 0
Version
11
Skapad
2021-07-15
Uppdaterad
2023-11-04
Licens
N/A
Gäller för

Automatically adds a Table of Contents block under the Pins sidebar of any entity on Kanka. Keep in mind that this runs exclusively in the client and makes no change to your Kanka campaign, nor is it visible on any browser or device other than the ones this script is installed on. You can however customize its appearance using campaign CSS.

The script is also able to add links back to the table of contents on every heading (entry/post box headings are excluded), but this is turned off by default. To activate this feature, locate the following line under the /* Preferences */ section and change false to the desired text within quotation marks:

const addTopLink = false; --> const addTopLink = "toc";

Note that you will need to reimplement this change each time you update the script.

Note: This plugin is compatible with Kanka’s own tables of contents ({table-of-contents}) even though it uses a different naming convention for HTML IDs. You can use it to supplement the "native" ToCs as it will include all sections of the entity rather than only the posts/entry where a ToC was explicitly included, and provide back-to-top links if enabled.


If my scripts are making your life easier, please consider tipping via Ko-fi (no account needed):

Support me on Ko-fi.com