markmv - v1.39.2
    Preparing search index...

    Class TocGenerator

    Utility for generating table of contents from markdown content.

    This class extracts headings from markdown content and generates formatted table of contents with proper indentation and anchor links.

    Basic usage

    const generator = new TocGenerator();
    const content = `# Title\n## Section 1\n### Subsection\n## Section 2`;
    const result = generator.generateToc(content);

    console.log(result.toc);
    // Output:
    // - [Title](#title)
    // - [Section 1](#section-1)
    // - [Subsection](#subsection)
    // - [Section 2](#section-2)

    With custom options

    const generator = new TocGenerator();
    const options = {
    minDepth: 2,
    maxDepth: 4,
    includeLineNumbers: true
    };
    const result = generator.generateToc(content, options);
    Index