I added an xslt file, xhtml-epub.xslt, that uses the MMD metadata to
create metadata that is read by calibre.
I then use the command:
ebook-convert file_to_convert.html .epub
--level1-toc="//*[name()='h2']" --use-auto-toc --no-default-epub-cover
to generate an epub using the calibre command-line tools. It just
isn't worth the time and effort for me to reinvent the wheel to
directly convert MMD into epub when calibre already exists and is
available on any platform.
You do need to manually create a title page if you desire one.
Otherwise the results seem pretty good (not perfect). The less
formatting (e.g. more like a novel) the better the results. MathML
doesn't work, but images and basic tables do. You can, of course,
tweak the way calibre works to change the output, and you can use CSS
to customize the output as well. You can add the epub to itunes, or
calibre, or use whatever method you like to install the epub onto your
I have attached an epub of the user's guide for demonstration purposes.
Fletcher T. Penney