Skip to content

Instantly share code, notes, and snippets.

@rdhyee
Created April 23, 2015 22:48
Show Gist options
  • Save rdhyee/fa228246c99268689d09 to your computer and use it in GitHub Desktop.
Save rdhyee/fa228246c99268689d09 to your computer and use it in GitHub Desktop.
Notes on how I generated EPUB from an AsciiDoc book using asciidoctor-htmlbook and HTMLBook

Starting point:

Code I used to generate the epub. (All paths for my own computer):

cd /Users/raymondyee/C/src/Dubliners_2814/
rm 2814.epub

asciidoctor -a toc -b xhtml5 -d book -T /Users/raymondyee/C/src/asciidoctor-htmlbook/htmlbook-autogen/ \
   --trace \
   2814.asciidoc

xsltproc -stringparam external.assets.list " " \
         /Users/raymondyee/C/src/HTMLBook/htmlbook-xsl/epub.xsl 2814.html 

# copy desired epub.css
cp epub.css OEBPS

# copy desired cover -- hardwired right now to png
cp cover.png OEBPS

# remove extraneous index.html
rm OEBPS/index.html 

zip -rX 2814.epub mimetype OEBPS/ META-INF/

No errors in generated EPUB according to epubcheck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment