gitbook-plugin-itoc

1.0.1 • Public • Published

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.
  • dir : Position of TOC
    • Allowed values:
      • before-first (default) : Before the first heading
      • top : On top of the page
  • 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.

Package Sidebar

Install

npm i gitbook-plugin-itoc

Weekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • allex