Skip to content
Erlend Hamberg edited this page Jun 6, 2014 · 1 revision

By installing pandoc and using the following script, you can generate an ePub version of the book with the inline code snippets syntax highlighted:

#!/bin/bash -e -x

mkdir -p docbook
for chapter in `ls *.asciidoc`
do
    chapter_name="${chapter%.*}"
    asciidoc --backend=docbook --out-file=docbook/$chapter_name.xml $chapter
done

cd docbook
cat book.xml `ls *.xml|grep -v book.xml`|\
	perl -pe 's|<literal>(.*?)</literal>|<code language="erlang">\1</code>|'|\
	pandoc -f docbook -t epub -o ../book.epub
Clone this wiki locally