ePub Boilerplate
A simple template that helps you build ePub-formatted books.
How to use the template
-
Clone the repo:
$ git clone [email protected]: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.
Structure of a book
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
ePub validation
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.
How to check your ebook
It's super easy. Just do:
$ ./check book.epub
This project currently uses EpubCheck version 4.0.
Style
Caveat lector: currently there aren't any defined styles. While I add a basic layout have a look at the ePub CSS Starter Kit.
ePub → mobi
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
.
Useful resources
EPUB 3
Metadata
- UUID generator
- BISAC Subject Headings List
- Practical ePub metadata: Authorship
- MARC Code List for Relators