simple-page-toc

README

Gitbook Simple Page TOC Plugin npm version

This plugin inserts a table of content (TOC) section into your GitBook page. It is powered by the markdown-toc library.

Usage

Installation

Add the plugin to your book.json:

{
    "plugins" : [ "simple-page-toc" ]
}

Create TOC

Place a <!-- toc --> code comment somewhere into your text. Generating your GitBook inserts a table of contents immediately after this comment.

Optional configuration

You can add the following configuration params to your book.json:

{
    "plugins" : [ 
        "simple-page-toc" 
    ],
    "pluginsConfig": {
        "simple-page-toc": {
            "maxDepth": 3,
            "skipFirstH1": true
           }
    }
}
Name Type Default Description
maxDepth Number 3 Use headings whose depth is at most maxdepth.
skipFirstH1 Boolean true Exclude the first h1-level heading in a file.

Changelog

  • 0.1.0 Releases:
    • 0.1.0 First release
    • 0.1.1 Fixed invalid config example in README (thanks at15)
    • 0.1.2 Fixed bug: Titles with hyphen builds with wrong anchor link

Plugin

Create a table of content (TOC) for a page in your Gitbook

https://github.com/stuebersystems/gitbook-plugin-simple-page-toc


Latest: 0.1.2

0.1.0, 0.1.1, 0.1.2,

Requirements

GitBook
0.1.2 >=3.1.1

Maintainers

Open on NPM