How to Create an EPUB with MMD

03/24/2017 09:45:00

MMD v6 includes many new features, one of which is the ability to create EPUB 3 files without any extra tools.

The new workflow for creating an EPUB is:

  1. Write your document using MMD.

  2. Convert to EPUB – multimarkdown -b -t epub file.txt

  3. There is no step 3….

Ok…. there is a slight bit more to know, but not much.

EPUB files use an identifier so that readers know when two files represent different versions of the same book. MMD uses UUID’s as identifiers, and will generate one for you randomly. If you want to be able to revise your EPUB in the future, then you can use the uuid metadata key in your text.

title:	Some Title
uuid:	a481c053-01d7-4426-832a-39a7a11966f6

MMD will look for your css metadata, as well as images that are used in the document. It will include these as assets in your EPUB, and link to the internal versions of those files.

  1. “Local” files include those that are on your computer and are referenced using relative locations such as “folder/file” or “../folder/file”. MMD will find these files and include them easily.

  2. “Remote” files are those that are referenced with full URLs, such as “”. MMD can’t access these by itself, and I don’t feel like writing an entire web crawler. However, MMD does use the libcurl library to do the downloading for you. This does require that the libcurl library is available at the time that MMD was compiled, and on your machine. This is easy on macOS machines, and libcurl support is included in the binaries provided at GitHub for macOS. I don’t have a way at the moment to do this for Windows, so if you need remote file support, you’ll need to compile MMD yourself to include it.

  3. Alternatively, you can always download any remote files yourself, and modify your MMD file to reference them locally, thereby solving the problem regardless of which OS you are using.

BONUS: My new app on the App Store for macOS, MultiMarkdown Converter Pro, includes EPUB 3 support. Just drag your MMD file to the window, and out pops the EPUB. It couldn’t be any easier!

If you want to see a few examples of MMD-generated EPUB’s, check out the Github page above and look at the DevelopmentNotes and QuickStart folders.


Similar Pages


Leave a comment