DEV Community

neuralmint
neuralmint

Posted on

Markdown TOC Generator CLI — Auto-Generate Table of Contents

Markdown TOC Generator CLI — Auto-Generate Table of Contents

Extract headings from any Markdown file and generate a clean table of contents. Depth control lets you choose how deep the TOC goes.

Features

  • Extract headings from markdown files
  • Depth control (e.g., H1–H3 only)
  • Clean indented list output
  • Supports #, ##, ###, etc.
  • Works with multiple files

Usage

# Generate TOC for a file
markdown_toc generate README.md

# Limit to H1-H2 only
markdown_toc generate README.md --depth 2

# Output with clickable anchors
markdown_toc generate README.md --anchors
Enter fullscreen mode Exit fullscreen mode

Install

pip install neuralmint/markdown-toc
Enter fullscreen mode Exit fullscreen mode

If this helps your documentation workflow:

SOL: 4TGyiYBjaYhFFPNYyCoJjf16ctUsWVBiMR1FXQxEfhWi

ETH: 0xe07f177E0725c11EEc8BeA34C5b5193CaF2a1A6a

Tags: python, cli, opensource, devtools
Series: neuralmint CLI Tools

Top comments (0)