icon mmd_merge

mmd_merge is a command-line utility for MultiMarkdown that combines several text files together before processing with MultiMarkdown. You could then have a separate file for each chapter in a book, for example.

You need a master “index” file that lists the files to be combined. This index file is a plain text file. Each line consists of the filename of the next document. If the line is indented, each tab (or 4 spaces) will increase the header level of the document by 1 (similar to the Base Header Level metadata). Blank lines are ignored. Lines starting with # are treated as comments. Only metadata from the first file would be properly handled, since it would be the only metadata at the top of the new “virtual” document.

MultiMarkdown Composer can automatically process an index file, to create a new window with the contents of the entire document. Simply open the index file, and then use the “File:Merge with mmd_merge” menu command.

NOTE: mmd_merge functionality is not compatible with the sandboxing required by the Mac App Store. You must use the non-sandboxed version of MultiMarkdown Composer to use this feature.

# Sample index file for `mmd_merge`
# This is a comment, and is ignored

# The following line links to a file that contains metadata
metadata.txt

# The following line is processed normally
introduction.txt

# The following line is indented with a tab, effectively acting
# like the metadata "baseheaderlevel: 1"
# All headers will be increased by one level (e.g. "##" becomes "###")
    subsection.txt