Bash Pubkit is a package for compiling books in the EPUB format from Markdown-formatted text files and accompanying images, fonts, and CSS stylesheets. Bash Pubkit comes with a book template and the compile.sh Bash shell script that uses Pandoc to generate books in the EPUB format.
The From Draft to EPUB book provides in-depth information on using Bash Pubkit.