# tscanlin/tocbot

Build a table of contents from headings in an HTML document.

Repository: https://github.com/tscanlin/tocbot
Canonical: https://ross.abutalabs.com/products/tocbot
Language: JavaScript
License: MIT
License Family: permissive
Topics: toc, html-document
Last push: 2026-05-15T04:34:18+00:00

## Health v2 (maintenance only)
Score: 86/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 82, release rhythm 84, longevity 100
- inputs: {"age_days": 3834, "days_push": 110, "days_rel": 110, "gap_med": 11.0, "n_releases_24m": 21}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1500, forks 114 (observed 2026-08-28T04:04:54.155736+00:00)

## What it is
Tocbot is a lightweight JavaScript library that builds a table of contents from headings in an HTML document using native DOM methods. It is designed for documentation sites and long pages, with no jQuery dependency.

## Use cases
- generate a table of contents from html headings
- add a sticky toc to documentation pages
- make long markdown-rendered pages easier to navigate
- build a collapsible heading outline in the browser
- add anchor-link navigation to blog articles

## When to choose
- you want a dependency-free TOC for a docs site or long article
- you need smooth scroll navigation to headings with ids
- you want a small vanilla JS solution without jQuery

## When to avoid
- your headings lack id attributes and you cannot generate them
- you need a server-rendered or build-time TOC rather than client-side
- you need a full documentation framework rather than just a TOC widget

## Facets
- artifact type: library
- maturity: stable
- function: ui-components, frontend-framework
- domain: web-development, frontend, documentation
- platform: browser
- tags: table-of-contents, toc, navigation, vanilla-javascript, zero-dependencies, nodejs

## Member repositories
- tscanlin/tocbot (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:54.155736+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:33:01.321837+00:00, confidence not recorded.
  - readme: https://github.com/tscanlin/tocbot (fetched 2026-08-28T04:04:54.155736+00:00, sha a19736fa37f3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
