Site icon Begin Self-Publishing

Inside an ePub

Inside an ePub

Episode 16

In today’s show (released on International Podcast Day!) I talk about how you go about manually editing an ePub file.  It is a very geeky technical show, but keep listening, I try not to make it too dull.

I’ve created a free ePub guide to editing an ePub (which you can get here) which explains this in a step-by-step text form.

Basically an ePub file is just a .zip file renamed as .epub with a particular structure:

Unzipped ePub – contents of an ePub when renamed as a zip file

The META-INF directory only contains one file, which does not really interest us in terms of editing an .ePub file.

The interesting part is the OPS directory:

The OPS folder

This contains a folder for the css (cascading style sheets), images (pictures included in the ePub, including the title) and the content files (the .xhtml files).

If you extract the files from the renamed .zip file you can then edit the .xhtml and .css files using an application like Notepad on a PC (to add effects like Drop Caps) and then when you are finished, zip up the files to create a new edited .epub file.

You should always start by zipping up the top-level mimetype file, however:

Creating a zip from the mimetype file

You then need to add the other folders (META-INF and OPS) to the newly created mimetype.zip file:

Copying directories into the mimetype.zip file

You can then rename the mimetype.zip file to something ending in .epub and you have a new edited ePub file.

To be a valid ePub file (according to the specification), the mimetype file needs to be the first file compressed, which is why I use such an odd method to create the new zip file.

You can validate ePub files at http://validator.idpf.org/ – for an ePub to be used to create a .mobi file or for sending out as a free eBook it doesn’t necessarily need to be valid – there are lots of errors that are minor and don’t effect the way the file is displayed.  However the Apple iBooks store requires that your eBook passes validation.

In this episode I also talk about the new formats of ePub supporting video, the need to tell people about podcasts for International Podcast Day (I’ll let you do it later if you listened later!) and my desire to do more in-depth episodes like this between the interview shows, so I can do a deep-dive into a subject area!

Exit mobile version