Really simple epub checking workflow

Use one folder to unpack, repack and validate your epub files

Dropbox, Scripts & Terminal icons

This is a handy way to quickly validate epub files on your Mac, (Mac only, I’m afraid) and preview them in iBooks.

Validating an epub file is a real pain, as it’s such a particular and unforgiving format. Browsers can be pretty forgiving about misplaced closing tags or poor HTML nesting, but .epub readers aren’t, often shutting down at the point where an error occurs.

Solving validation errors is a whole book in itself, never mind a blog post, but here’s a simple workflow and set of tools that you can have in one folder to make the process (relatively) painless.

Ingredients

You’ll need the following apps and scripts to make this work, but all are free.

  1. Dropbox (for storage and easily transferring files)
    You can sign up here if you don’t have an account, or use my affiliate link
  2. Terminal (for running epubcheck)
    Don’t panic if you’ve never used this before, it’s less complicated than it looks. 
  3. epubcheck (for validating .epub files)
    This is a Java tool for validation. It uses Terminal, but it’s really simple once it’s set up. Download the latest version.
  4. Epub Unzip (for unpacking .epub files)
    Available from this forum thread, as is the script below.
  5. Epub Zip (for repacking .epub files)
    Both scripts available from this forum thread. Scripts created by Dan Rodney

Instructions

Set-up

  1. Make a folder in Dropbox called “epubcheck” (or anything really)
  2. Download epubcheck, epubunzip and epubzip and copy the contents into this folder. It should look like this:

folder

Run-through

  1. Drag your .epub file into the folder (assume it’s called mybook.epub)
  2. Open Terminal and go to the epubcheck folder on Dropbox. (Tip: Just type “cd” and drag the folder into the terminal window to save time) – see animation below…

    terminal folder finder

  3. Type java -jar epubcheck-3.0.1.jar mybook.epub, and take note of all the errors.
  4. Drag mybook.epub onto ePub UnZip 1.0 – this will unpack your epub into its component files, allowing you to fix your errors.
  5. Fix as many errors as you can!
  6. Drag the mybook folder onto ePub Zip 1.0.3 – this will convert it pack into an epub, and save over the old file.
  7. Repeat until you are error free.
  8. On your iPad, open mybook.epub in Dropbox, and choose the option to open in iBooks. This will let you preview it on an actual device.

Step 5 (fixing the errors) is obviously the toughest part of all this, but hopefully these steps will make it fairly painless to get to the root of the errors rather than trying to find them in the first place.

We’re working on making it really simple to create your own publications and have them look great everywhere, so if there’s any way we can help, please let us know!

Leave a Reply

Your email address will not be published. Required fields are marked *