A simple template that helps you build ePub-formatted books.
-
Clone the repo:
$ git clone git@github.com:javierarce/epub-boilerplate.git
-
Edit the contents of the
book
directory1. -
Run the publish script to generate and validate the book:
$ ./publish book
1: You'll find comments inside several files to guide you.
Here's the structure of the sample book included in the repo:
▾ book/
▾ META-INF/
com.apple.ibooks.display-options.xml
container.xml
▾ OEBPS/
▾ Images/
cover.jpg
image-01.jpg
image-02.png
▾ Styles/
style.css
▾ Text/
acknowledgements.xhtml
chapter01.xhtml
chapter02.xhtml
chapter03.xhtml
cover.xhtml
dedication.xhtml
endnotes.xhtml
foreword.xhtml
frontmatter.xhtml
introduction.xhtml
toc.xhtml
content.opf
toc.ncx
mimetype
This project uses epubcheck to validate the generated ePubs. If the build.sh
script complains when running epubcheck
, make sure you have java installed and it's in your PATH
.
If you need help running epubcheck
read this step-by-step guide.
It's super easy. Just do:
$ ./check book.epub
This project currently uses EpubCheck version 4.0.
Caveat lector: currently there aren't any defined styles. While I add a basic layout have a look at the ePub CSS Starter Kit.
If you want to transform your .epub
file to .mobi
do this:
- Download KindleGen.
- Uncompress the file.
- Copy the
kindlegen
executable to thebin
folder. - Run
./bin/kindlegen book.epub
.