markmv - v1.39.2
    Preparing search index...

    Class BaseSplitStrategyAbstract

    Abstract base class for all split strategies.

    Provides common functionality for splitting markdown files including filename generation, frontmatter handling, and content sanitization. Concrete strategies implement specific splitting algorithms.

    Implementing a custom split strategy

    class CustomSplitStrategy extends BaseSplitStrategy {
    async split(content: string, originalFilename: string): Promise<SplitResult> {
    // Custom splitting logic
    const sections = this.customSplit(content);
    return { sections, remainingContent: undefined, errors: [], warnings: [] };
    }
    }

    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

    • Generate a safe filename from a title

      Parameters

      • title: string
      • index: number
      • originalFilename: string

      Returns string

    • Sanitize a string to be safe for use as filename

      Parameters

      • str: string

      Returns string

    • Extract frontmatter from content

      Parameters

      • content: string

      Returns { frontmatter: string; content: string }

    • Extract title from header line

      Parameters

      • headerLine: string

      Returns string

    • Count the header level (number of # characters)

      Parameters

      • line: string

      Returns number

    • Check if a line is a header at or above the specified level

      Parameters

      • line: string
      • targetLevel: number

      Returns boolean