Greasy Fork is available in English.

Toc Bar

A floating table of content widget

От 07.07.2020. Виж последната версия.

Автор
hikerpig
Рейтинг
0 0 0
Версия
1.3.0
Създаден
01.07.2020
Обновен
07.07.2020
Лиценз
MIT
Работи на

Toc Bar

A user script that adds floating widget displaying table of content of current page.

Currently only tailored for some personal most-visited sites. Feel free to tweak the settings or open a PR.

✨Features

  • Use tocbot for toc generation.
  • For some sites, there are no ids on header elements so it would be impossible to navigate by clicking the toc link. Toc Bar will generate ids - which are derived from a simple hash of the header textContent, and prefixed with tocbar- - for these headers.
  • A toggle button is offered, if you don't want toc bar to cover current page content.
  • For some sites in SPA mode, if you navigate to another article, there is no easy way detecting url change in userscript, so I add a refresh button to refresh TOC contents.

Screenshots

devto

zhuanlan-sspai

Acknowledgements

Inspired by github-toc by Mottie.

The logo uses Mexellent font made by Raymond Larabie.

CHANGELOG

v1.3.0 (2020-07-05)

Features

  • store tocbar position and toggle status using GM_setValue, read them during init
  • add initialTop to site setting

v1.2.0 (2020-07-05)

Features

  • Add logo, and adjust some styles (ba90dac)

v1.1.0 (2020-07-04)

Features

  • Add header hash functionality (970dd0a)
  • guess theme color from document.head meta (4db05b5)
  • remove tocbot style resource, add a modified version to tocbar style (5ebdde0)