Skip to content

Workflow

How to merge Markdown files without broken links or headings

Plan, reorder, and combine Markdown chapters while preserving sources and resolving cross-file references deliberately.

MDLoom documentation9 min read

Concatenation is not composition

Appending bytes can produce multiple title headings, duplicate reference labels, conflicting footnotes, broken relative links, and asset paths that only worked from the original folder. A semantic merge parses each file before assembling a new output.

Generating a composition does not overwrite imported files on disk. The workbench keeps editable source entries plus order, inclusion settings, optional heading offsets, separators, and output metadata separate from the generated result.

Prepare each source as a chapter

Give each file a clear role and predictable base directory. Decide whether file-level titles become chapter headings and whether front matter belongs to the whole publication or only to an individual source.

  • Resolve missing assets and ambiguous case-sensitive paths.
  • Use stable explicit link destinations for cross-chapter references.
  • Make reference labels and footnote identifiers unique where possible.
  • Choose one Markdown profile for the composition output.

Reorder with an outline, not filenames alone

A composition workbench should show file order and the resulting heading outline together. Keyboard and button controls are as important as drag-and-drop for precise and accessible rearrangement.

Preview the generated document before export. The current workbench attributes merge diagnostics to the original source file; line-level generated/source mapping remains a later refinement.

Read the merge report

MDLoom's current report describes capped heading shifts, rewritten relative paths, namespaced references and footnotes, front-matter decisions, and missing or captured assets. It keeps those changes visible instead of collapsing them into a single success message.

Put it into practice

Open a clean workspace for your next document.

Start anonymously, choose an explicit Markdown profile, and keep source, preview, and diagnostics together.

Open the editor  →