TOC Sidebar is a user script that adds a table of contents (TOC) sidebar to any webpage, enhancing navigation and improving the reading experience.
- Automatically generates a table of contents from the headings on the page
- Toggle sidebar visibility with the t key, or Customizable global shortcut key
- Resizable sidebar
- Expand/collapse functionality for nested headings
- Highlights the current section as you scroll
- Smooth scrolling to selected headings
- Intelligent content detection to avoid including irrelevant headings
- Ability to toggle the TOC sidebar from the Tampermonkey menu
- Improved navigation: Quickly jump to any section of the page
- Enhanced readability: Get an overview of the page structure at a glance
- Non-intrusive: Toggle the sidebar on and off as needed
- Customizable: Resize the sidebar to your preferred width
- Universal compatibility: Works on most websites without interfering with existing layouts
- Install a user script manager like Tampermonkey - Chrome Web Store or Greasemonkey – Firefox in your browser
- Install the TOC Sidebar script: https://raw.githubusercontent.com/xianmin/userscript-toc-sidebar/master/toc-sidebar.user.js
- Visit any webpage, and press the 't' key to toggle the sidebar
- Click on any heading in the sidebar to navigate to that section
- Use the '+' and '-' buttons to expand or collapse all headings
- Drag the right edge of the sidebar to resize it
- Click the 'X' button or press 't' again to close the sidebar
You can customize the global shortcut key used to toggle the TOC sidebar:
- Click on the Tampermonkey icon in your browser
- Select "TOC Settings" from the menu
- In the settings panel, click on the "Trigger Shortcut" field
- Press the desired key combination (e.g., Ctrl+T)
- Click "Save" to apply the new shortcut
The new shortcut will be applied globally across all pages where the script runs.
You can also toggle the TOC sidebar directly from the Tampermonkey menu:
- Click on the Tampermonkey icon in your browser
- Look for the "Toggle TOC" option in the menu
- Click on "Toggle TOC" to show or hide the sidebar
This provides an alternative way to access the TOC sidebar without using the keyboard shortcut.
Enjoy easier navigation and improved reading experience with TOC Sidebar!