Generate or update table of contents for a documentation file. Creates markdown TOC from headers. Use after adding sections or to standardize existing docs.
Generate or update a markdown table of contents for a documentation file.
Read the target file
Extract all headers (H2 and H3 only):
Generate anchor links:
## Getting Started -> #getting-startedFormat the TOC:
## Table of Contents
1. [Section One](#section-one)
2. [Section Two](#section-two)
- [Subsection A](#subsection-a)
- [Subsection B](#subsection-b)
3. [Section Three](#section-three)
## Table of Contents exists, replace its contentsInput file:
# My Guide
This guide explains something important.
## Prerequisites
Content...
## Installation
Content...
### Using pip
Content...
### Using conda
Content...
## Configuration
Content...
## Related Resources
Links...
Generated TOC:
## Table of Contents
1. [Prerequisites](#prerequisites)
2. [Installation](#installation)
- [Using pip](#using-pip)
- [Using conda](#using-conda)
3. [Configuration](#configuration)
/doc-toc docs/guides/getting-started.md
/doc-toc example/api/authentication.md