Skip to content

aleung/gitbook-plugin-page-toc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitbook-plugin-page-toc

Add Table of Contents (TOC) to every page in your GitBook.

It adds anchors link to headings inside the page as well.

Install

Add the plugin to your book.json:

 { "plugins": [ "page-toc" ], "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.
  • position : Position of TOC
    • Allowed values:
      • before-first (default) : Before the first heading
      • top : On top of the page

CSS Customization

The TOC elements have class attribute .page-toc. You can override the styles in styles/website.css.

About

Add Table of Contents (TOC) to every page in your GitBook.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •