Joins multiple markdown files into a single output file.
This method processes the input files according to the specified strategy, handles header levels, manages frontmatter, and ensures proper link resolution. It supports various joining strategies including alphabetical, dependency-based, chronological, and manual ordering.
Array of file paths to join together
Configuration options for the join operation
Promise resolving to operation result with success status and file changes
const result = await joiner.joinFiles(
['chapter1.md', 'chapter2.md', 'chapter3.md'],
{
outputPath: 'book.md',
strategy: 'manual', // Preserve input order
headerLevelOffset: 1, // Shift headers down one level
preserveHeaders: true,
handleFrontmatter: 'first' // Use first file's frontmatter
}
);
Combines multiple markdown files into a single file using configurable strategies.
The ContentJoiner provides intelligent merging of markdown content with support for different ordering strategies, header management, and frontmatter handling. It can handle complex scenarios like dependency resolution and conflicting content.
Example
Basic file joining
Example
Advanced joining with dependency ordering