gitbook-plugin-itoc
Add Table of Contents (TOC) to every page in your GitBook.
It adds anchors link to headings inside the page as well.
Base from gitbook-plugin-page-toc
Install
Add the plugin to your book.json
:
{
"plugins": [ "itoc" ],
"pluginsConfig": {
}
}
Configuration
-
selector
: CSS selector to select the elements to put anchors on- Default:
.markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4
, which include headings from level 1 to level 4.
- Default:
-
dir
: Position of TOC- Allowed values:
-
before-first
(default) : Before the first heading -
top
: On top of the page
-
- Allowed values:
-
position
: Position of TOC-
static
(default) -
fixed
: Fix off from scroll
-
CSS Customization
The TOC elements have class attribute .page-toc
. You can override the styles in styles/website.css
.