您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically adds a table of contents to Kanka entity pages under the Pins sidebar.
当前为
Automatically adds a Table of Contents block under the right-hand History sidebar of all entities on Kanka. You can customize its appearance using campaign CSS, but keep in mind that it is only visible on browsers where this script is installed. It should match the appearance of other sidebar blocks out of the box.
When clicking a link to a collapsed post, the post will automatically expand so you are scrolled to the correct position.
The script can also add links to scroll back to the table of contents after every heading (excluding entry/post box headings), but this is turned off by default. To activate this feature, locate the following line under the /* Preferences */
section and add the desired text inside the quotation marks:
const addTopLink = "";
→ const addTopLink = "toc";
Note that you will need to reimplement this change each time you update the script.
Note: This script will not conflict with Kanka’s own tables of contents ({table-of-contents}
). You can use it to supplement the "native" tables of contents, and create back-to-top links if enabled.