Pandoc

Pandoc converts files from one markup format into another. Including, as of version 1.6, from Markdown to epub.