VibeHunt
Back to browse

DocToc

Generates table of contents for markdown files.

DocToc is a command‑line tool that scans Markdown files in a local Git repository and inserts or updates a generated table of contents. It parses headings and creates a list of links that match the anchor format used by GitHub and other sites, ensuring the TOC stays in sync with the document structure. The tool can be run on individual files, whole directories, or as a Git hook, and it supports a dry‑run mode that prints the result to standard output.

Users can customize the TOC with options for title text, header and footer content, and the range of heading levels to include. Flags such as `--minlevel`, `--maxlevel`, and `--all` control which headings appear, while `--notitle` and `--title` let users add or remove a title. Additional configuration includes minimum item counts and line thresholds, and the output can be padded or indented according to preference.

DocToc is distributed as an npm package with a global CLI entry point, and a Docker image is also provided. It is marked as stable and includes a CI badge indicating ongoing automated testing. The generated TOC is wrapped in clearly marked comment blocks, allowing the tool to replace the section automatically on subsequent runs.

Reviews

Sign in to leave a review.

Loading reviews…

Similar apps