How lzayou/md-toc works
md-toc is a small, dependency-free Markdown TOC generator. Its main workflow is a user invoking the CLI with a file or piped input; the CLI parses and filters headings, derives GitHub-style anchors, renders a nested or flat list, and writes it to standard output. The core module also exposes these operations as a Python API. The source excerpts show the CLI-to-core calls and internal parsing stages; README usage documents the user-facing modes and options.
Main entry points: cli.py CLI · core.py Heading parser
Components 7
Other components
- User
- Markdown input
- CLI
md_toc/cli.py - Heading parser
md_toc/core.py - Anchor generation
md_toc/core.py - TOC renderer
md_toc/core.py - Standard output
Connections 6
- User → CLI: invokes
README.md - CLI → Markdown input: reads
md_toc/cli.py - CLI → Heading parser: parses headings
md_toc/cli.py - Heading parser → Anchor generation: derives anchors
md_toc/core.py - CLI → TOC renderer: renders headings
md_toc/cli.py - CLI → Standard output: prints TOC
md_toc/cli.py