Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
An ebook epub build script using mostly Pandoc. I use this one to build "Game Construction Kit: Underwater Tomato Ninja".
# (in epub)
# prep the output directories
mkdir ./_epub/illustrations/
mkdir ./_epub/audio/
# copy assets to the epub structure
rsync --verbose --update --recursive --progress --times ./illustrations/ ./_epub/illustrations/
rsync --verbose --update --recursive --progress --times ./audio/ ./_epub/audio/
cp "epub.css" "./_epub/epub.css"
# copy the chapter files into the book folder structure
cp "" "./_epub/01-introduction/"
cp "" "./_epub/02-instructions-and-setup/"
cp "" "./_epub/03-play-and-question-the-game/"
cp "" "./_epub/04-code-is-communication/"
cp "" "./_epub/05-introduction-to-game-design/"
cp "" "./_epub/06-inside-the-game-engine/"
cp "" "./_epub/07-creating-art--sound--and-text-for-a-game/"
cp "" "./_epub/08-the-game-engine/"
cp "" "./_epub/09-advanced-animation/"
cp "" "./_epub/10-reflecting-on-what-we-ve-learned/"
cp "" "./_epub/11-appendices/"
cd _epub
# build the book in pandoc
pandoc -S --epub-cover-image=illustrations/gck-utn-cover-01.png -o gck-utn-book.epub --epub-stylesheet=epub.css --epub-metadata=metadata.xml -o gck-utn-book.epub title.txt \
"01-introduction/" \
"02-instructions-and-setup/" \
"03-play-and-question-the-game/" \
"04-code-is-communication/" \
"05-introduction-to-game-design/" \
"06-inside-the-game-engine/" \
"07-creating-art--sound--and-text-for-a-game/" \
"08-the-game-engine/" \
"09-advanced-animation/" \
"10-reflecting-on-what-we-ve-learned/" \
# open the book to test and preview
open /Applications/ ./gck-utn-book.epub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.