Skip to content

Table of Contents 🚧 WIP

A table of contents (TOC) helps users navigate through your README by providing a structured overview of all sections. README-AI offers various TOC styles to enhance readability and organization of your documentation.

TOC Style Options

Use the --toc-style option to select from the following styles:

🔗 Table of Contents


🚧 WIP

🔗 Table of Contents

  1. Overview
  2. Features
  3. Installation
  4. Usage
  5. Contributing
  6. License

🚧 WIP

🔗 Table of Contents

I. Overview
II. Features
III. Installation
IV. Usage
V. Contributing
VI. License


How It Works

README-AI automatically generates a table of contents based on the headers in your README file. The process involves:

  1. Section Detection: Analyzes markdown headers (H1-H6) in your content
  2. Anchor Generation: Creates anchor links by converting headers to URL-friendly format
  3. Style Application: Formats the TOC according to your chosen style
  4. Hierarchy Preservation: Maintains proper nesting of subsections (where applicable)

Usage

Using the default bullet style:

readmeai --toc-style bullet --repository https://github.com/username/project

Using the fold style, which nests the index under a collapsible section:

readmeai --toc-style fold --repository https://github.com/username/project

Customizing the TOC with additional CLI options:

readmeai --toc-style number \
         --header-style modern \
         --badge-style flat \
         --repository https://github.com/username/project