Nice and thanks for sharing your setup. The footer is very informative, but I use GitHub style markdown, need to check if there's some workaround. For epub customization, this article [0] might help. Good luck for your book.
Here's how I generate PDF with pandoc+xelatex [1] I use gvim as my editor and have mapped a key (which then executes a shell script) to generate the book.