markmv - v1.26.2
    Preparing search index...

    Class DependencyGraph

    Builds and analyzes dependency relationships between markdown files.

    The DependencyGraph tracks file relationships through links, references, and imports to enable intelligent file operations. It supports cycle detection, topological sorting, impact analysis, and dependency-aware ordering for operations like joining and splitting.

    Building a dependency graph

    const graph = new DependencyGraph();

    // Add files to the graph
    await graph.addFile('intro.md');
    await graph.addFile('setup.md');
    await graph.addFile('usage.md');

    // Analyze dependencies
    const order = graph.getTopologicalOrder();
    console.log('Processing order:', order);

    // Check for circular dependencies
    const cycles = graph.detectCycles();
    if (cycles.length > 0) {
    console.warn('Circular dependencies detected');
    }

    Impact analysis

    const graph = new DependencyGraph(parsedFiles);

    // Find all files affected by changing api.md
    const impacted = graph.getImpactedFiles('api.md');
    console.log(`${impacted.length} files will be affected`);
    Index

    Constructors

    Methods

    • Parameters

      • oldPath: string
      • newPath: string

      Returns void