Skip to content

Instantly share code, notes, and snippets.

@kopp
Created April 12, 2021 16:07
Show Gist options
  • Save kopp/aa9868534b231de7267fbf1660639620 to your computer and use it in GitHub Desktop.
Save kopp/aa9868534b231de7267fbf1660639620 to your computer and use it in GitHub Desktop.
build epub for aim42
git clone https://github.com/aim42/aim42.git
cd aim42
docker run -it -v $(pwd):/documents/ asciidoctor/docker-asciidoctor
asciidoctor --doctype book -a imagesdir=../resources/images -a icons=font -a toc=left -a sectlink=true -a sectanchors=true -a numbered=true, -a source-highlighter=coderay -a coderay-css=class -a stylesheet=aim42.css -a stylesdir=../resources/css/ -a version=0.8.0 -a data-uri=true --out-file a.html --source-dir src/main/asciidoc/ src/main/asciidoc/index.adoc

Note: data-uri will include the image content in the HTML; see here.

Directly create the epub via

asciidoctor-epub3 --doctype book -a imagesdir=../resources/images -a icons=font -a toc=left -a sectlink=true -a sectanchors=true -a numbered=true, -a source-highlighter=coderay -a coderay-css=class -a stylesheet=aim42.css -a stylesdir=../resources/css/ -a version=0.8.0 -a data-uri=true --out-file a.epub --source-dir src/main/asciidoc/ src/main/asciidoc/index.adoc 

will not contain the images.

Instead import the generated HTML using calibre and convert to EPUB.

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