# thlorenz/doctoc

📜 Generates table of contents for markdown files inside local git repository. Links are compatible with anchors generated by github or other sites.

Repository: https://github.com/thlorenz/doctoc
Canonical: https://ross.abutalabs.com/products/doctoc
Homepage: https://www.npmjs.com/package/doctoc
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-08-04T16:02:57+00:00

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 96, release rhythm 76, longevity 100
- inputs: {"age_days": 5212, "days_push": 29, "days_rel": 82, "gap_med": 45, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4462, forks 486 (observed 2026-08-28T04:08:50.724619+00:00)

## What it is
DocToc is a Node.js command-line tool that generates and maintains table of contents sections in Markdown files within a local git repository. The generated links are compatible with anchor formats used by GitHub, GitLab, Bitbucket, and other sites.

## Use cases
- add a table of contents to my README
- generate TOC for all markdown files in a repo
- check that docs table of contents is up to date in CI
- update existing doctoc TOCs automatically
- use a git hook to keep markdown TOCs current
- generate GitHub-compatible anchor links for headings

## When to choose
- you maintain markdown documentation in a git repository and want navigable TOCs
- you need TOC links that work on GitHub/GitLab/Bitbucket
- you want to enforce up-to-date TOCs in CI via dry-run exit codes

## When to avoid
- you need TOCs for non-markdown formats like reStructuredText or AsciiDoc
- you want a GUI or in-editor TOC tool rather than a CLI
- you need fully custom TOC rendering beyond the provided renderers

## Facets
- artifact type: cli-tool
- maturity: active
- function: markdown, documentation, parser, cli
- domain: documentation, developer-tools
- platform: cli, cross-platform
- tags: table-of-contents, markdown-toc, github-anchors, git-hook, npm-package, command-line, nodejs

## Member repositories
- thlorenz/doctoc (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:50.724619+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-29T18:20:41.552166+00:00, confidence not recorded.
  - readme: https://github.com/thlorenz/doctoc (fetched 2026-08-28T04:08:50.724619+00:00, sha de5547551ee5)
  - registry_npm: https://registry.npmjs.org/doctoc (fetched 2026-08-29T09:07:41.413064+00:00, sha fa8364be4241)
- Data as of 2026-08-30T08:39:29.467469+00:00.
