Skip to content

Feature Request: Table of Contents (TOC) Generation #27

@Mearman

Description

@Mearman

Feature Request: Table of Contents (TOC) Generation

Description

Add functionality to automatically generate table of contents for markdown files based on their header structure.

Use Case

  • Automatically generate TOCs for large documentation files
  • Keep TOCs in sync when headers change during file operations
  • Provide consistent navigation structure across documentation

Proposed Implementation

# Generate TOC for a single file
npx markmv toc document.md

# Generate TOC with custom depth
npx markmv toc document.md --depth 3

# Generate TOC with custom position
npx markmv toc document.md --position after-title

# Update existing TOC
npx markmv toc document.md --update

Integration with Existing Features

  • When splitting files, automatically generate TOCs for resulting files
  • When joining files, merge TOCs or generate new comprehensive TOC
  • When moving files, update TOC links automatically

Expected Output

  • Insert TOC at specified position in markdown file
  • Support for different TOC formats (numbered, bulleted, linked)
  • Configurable depth levels and filtering options
  • Automatic link generation to headers

Additional Context

This would complement the existing documentation organization features and provide better navigation for large markdown files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions