I am creating some e-books for a client and here I share some of my journey.
An e-book is simply a digital version of a book that can be read on a computer or mobile device. There are a number of different formats (Apple's iBooks, Amazon's Kindle, etc.) as well as a lot of companies who use PDF (Portable Document Format) that is readable on most browsers or by Adobe Reader.
I am talking here about e-books for Apple's iBookStore that are stored in the .epub format.
The .epub format is an open standard for e-books and is simply a (zipped) collection of XHTML files (typically one for each chapter), some images, a stylesheet and some 'manifest' files to describe the contents and sequence.
I created my first e-books - editing the XHTML files and building the manifest files - by hand. It is the long way round, but at the end you know that your publication is valid at every level.
I looked, on a number of occasions, for some eBook tools but found that most e-book creation software is a) expensive, b) has a high learning curve or c) mangles the underlying XHTML and CSS data. Some manage to do all three.
Now that Apple’s pages allows you to create an EPUB file (File / Export) I thought would be an easy-peasy process, but checking the epub internals shows some pretty messy output. Revisiting the excellent article that got me started (Creating eBooks: An ePub Tutorial) led me to an application called Sigil ("a WYSIWYG epub editor" ).
Sigil seems to provide just the right level of hands on coding and WYSIWYG views and has the tools for creating table of contents, validation, and publishing, making the rest of this blog redundant for all except anyone still doing things the hard way.
ThreePress provide an on-line epub validator (http://threepress.org/document/epub-validate) but for regular use you should download ePubChecker.
The .epub file is basically a ZIP archive of files. The mimetype file must be the correct length and must come before the other files. On the Mac you also need to exclude the .ds_store file.
I found a useful little app called ePub Zip (version 1.0.2) which zips the folder without any fuss.
I recently had problems using the following zips, even though they worked back in 2010
zip -X0 mysample.epub mimetype
zip -rDX9 mysample.epub * -x "*.DS_Store" -x mimetype
This is the one I used back in 2010:
zip -Xr9D mysample.epub mimetype * -x *.DS_Store