My ebook boilerplate is a command-line script that uses Pandoc, wkhtmltopdf, and Calibre to compile all of the files, syntax highlight code snippets, and automatically generate all of the file formats.
I’ve recently been discussing with Clair some options for publishing an ebook, which reminded me of this.
This is Chris Ferdinandi’s set-up for creating an ebook in multiple formats (PDF, EPUB, MOBI, HTML) from a collection of markdown files.
Also useful, on the same subject: Heydon Pickering’s Every Layout is Released: Some Facts and Andy Bell’s Every Layout: How it works