Generate a table of contents based on the heading structure of an html document


github-actions cdnjs GitHub Sponsors

Tocbot builds a table of contents (TOC) from headings in an HTML document. This is useful for documentation websites or long markdown pages because it makes them easier to navigate. This library was inspired by Tocify, the main difference is that Tocbot uses native DOM methods and avoids the jQuery & jQuery UI dependencies.

Get Started

You can use npm to install it or include the script on the page with HTML.

Download it here

Include JS

  • commit dist/
  • run npm publish
  • make release on github
  • License