Of course, some authors may wish to exert
far more control over the publishing process. Is there a way for an author to
be in total control of the publishing process? The answer is yes if they
publish their e-book using the EPUB format.
In contrast to many other e-book formats,
EPUB is an open standard. In other words, all the elements that are required to
create an EPUB file are publicly defined. Even better, these elements are
themselves also based on open standards. The result is EPUB e-books can be created
and modified by anyone, using only a simple set of tools, and distributed
without any digital rights protection issues.
With EPUB the author can exert full control
on the cover design, the content layout, plus all the associated extras
including appendixes, table of contents, references and indexes.
This level of control will require at least
a basic understanding of languages such as HTML, CSS and XML. However, anyone
who maintains their own website will almost certainly have enough knowledge to
perform this work. And as these skills are fairly widespread, an author may
already know of friends or colleagues who could assist with the necessary
The EPUB Format
So, what is an EPUB file? In essence, it's
just a zipped container that holds a collection of HTML, CSS and XML files. Any
unzip tool will be able to extract the file contents, even though it has an
'.epub' file extension rather than the more usual '.zip' one.
After the EPUB file is unzipped, what do we
see? Taking the current 2.0 specification, the root folder will contain all the
content files, in HTML or XHTML format, plus a few special files such as
'content.opf' and 'toe. ncx'. In addition there are a number of appropriately
named subfolders to contain images, style definition and any special fonts. The
files 'content.opf' and 'toe.ncx' are in EPUB-specific XML format. As you can
no doubt guess, they are instrumental in providing the table of contents, so
they need to be kept in sync with each other.
While there could be just a single e-book
content file, in practice an EPUB book is usually broken down into a collection
of small chunks. The number and length of these chunks is completely at the
discretion of the e-book creator, although new sections and chapters are
obvious divisional candidates. Typically, you also find a separate file for the
book's cover, in addition to files for the introductory pages and index.
To ensure your e-book is supported by the
widest range of e-reader devices you should only use simple HTML. The more HTML
elements you include and the more sophisticated your styles become, the more
chance there is of something not being displayed too well.
I've personally had seemingly innocuous
HTML code crash my own e-reader once or twice. So, sticking to simple HTML code
will ensure the most consistent reading experience for your prospective
audience. Selecting XHTML for the e-book content files will allow an editor to
check your handiwork using a much stricter set of validation rules than is
possible with HTML.
Now we've discovered the EPUB format is
just a zipped collection of files, you'll no doubt expect editing and
customising an EPUB e-book is going to be a pretty straightforward exercise,
and you'd be right.
One way to do this would be to unzip all
the files into a new folder. Once unzipped, any of the HTML, CSS and XML files
can be modified using any text editor, such as Notepad on Windows, TextEdit on
a Mac, Vi on Linux and so on. After editing, all the files in the folder are zipped
back up into a file with an '.epub' extension.
If all this still sounds like a bit too
much trouble, there's an easier route to EPUB customisation. Sigil is a freely
downloadable, open-source EPUB-editing application with active community
support and regular updates.
How does Sigil make things easier? When
Sigil opens an EPUB file, it automatically unzips all the components. The
complete list of files is displayed in a tree-like structure to the left of the
application window - see figure 1.
Click on a specific item in the list and
the file contents will be displayed in the main panel. For an HTML or XHTML
file you'll see a browser-like representation by default, similar to how it
would appear on an e-reader. Switch to a different view mode to display the
underlying HTML source code, or to have a split view where the browser-rendered
representation and source code are both visible, as in figure 2.
If a CSS or XML file is selected from the
file list tree, the main panel in Sigil will automatically display the source
code. New HTML, CSS, XML or image files can be inserted into the EPUB file
list. Image files can be in any of the commonly used web-supported formats, but
they'll need to be created and edited with a separate image editor application.
with split HTML view
Future versions of the EPUB standard will
remain HTML-based. However, the latest version (3.0) will also incorporate
support for HTML5 and CSS3. This will usher in significant change, including
the ability to natively support multimedia content in the form of audio
segments and video clips. As a result, the EPUB file structure will evolve to
accommodate these changes. However, with Sigil you'll be able to upgrade to a
newer version and be shielded from these structural changes.