markmv - v1.39.2
    Preparing search index...

    Class HeaderBasedSplitStrategy

    Split strategy that divides content based on markdown headers.

    Splits the file at headers of a specified level, creating a new file for each section. This is ideal for documents with clear hierarchical structure where each major section can stand alone.

    Header-based splitting

    const strategy = new HeaderBasedSplitStrategy({
    headerLevel: 2, // Split on ## headers
    outputDir: './sections/',
    filenamePattern: '{title}'
    });

    const result = await strategy.split(content, 'document.md');
    console.log(`Created ${result.sections.length} sections`);

    Hierarchy (View Summary)

    Index
    • Returns value unless it is nullish or the empty string, in which case fallback is used -- an empty string is treated as "no value supplied" rather than a meaningful value to preserve.

      Parameters

      • value: string | null | undefined
      • fallback: string

      Returns string

    • Returns value unless it is nullish or zero, in which case fallback is used -- zero is not a meaningful value for these options (header levels start at 1, size limits must be positive).

      Parameters

      • value: number | undefined
      • fallback: number

      Returns number