Easier EPUB Experimenting and Updating in iBooks

by Keith Fahlgren

[Update: Liz Castro has an even easier post on editing EPUB files directly on the iPad.]

The arrival of iBooks this year helped many people understand that ebooks were already capable of interesting experimentation, multimedia, and nuanced, thoughtful design. Many of iBooks’ strengths come directly from the fact that they wisely chose to base it on WebKit, the rendering engine core used in desktop browsers like Safari & Chrome and mobile browsers for the iPhone, iPad, Android, and now Blackberry browsers. This makes it an attractive test platform for folks developing new and innovative content in EPUB, but many have been frustrated with the time and effort it takes to update EPUB content in iBooks on an iPad using the iTunes sync. This post outlines an easier approach for iteratively developing and testing changes to EPUB XHTML and CSS files in iBooks (1.1.2) without using iTunes.

Here’s a tweak to the XHTML of a chapter and the CSS used for h1s that I did quickly without having to make a new EPUB or use iTunes:

A screenshot from an iPad in iBooks show content modified without a sync

The key to this hack technique is the free (as in beer) iPhone Explorer application, which exposes the contents of your iPad like a USB drive (including resources for Apps). It has both a Mac and Windows version, but I’ve only tested these instructions on a Mac. Before starting, connect your iPad to your computer and iTunes. You should not be using automatic syncing (“Sync Books” is not checked).

To get started playing with a particular EPUB, sync the file onto your iPad, open the book once in iBooks, then close iBooks. Now you’re ready to start moving the files back and forth (iPhone Explorer is all drag and drop).

  1. Open iBooks to your Library (not a book).
  2. Open iPhone Explorer (or hit Refresh if it was open, but this is occasionally flaky).
  3. Expand [Your] iPad->Media->Books.
  4. Find the [XXXX].epub you’re interested in and expand it until you find your XHTML content or CSS.
  5. Drag the XHTML file or CSS you want to experiment with somewhere on your computer (perhaps your Desktop in the Finder) to edit.
  6. Edit the file using something you like.
  7. Drag the XHTML or CSS file back from your computer to the same location in iPhone Explorer.
  8. Say “OK” to the “Overwrite?” dialog.
  9. Open the book in iBooks to see the changes.

A screenshot of updating content using iPhone Explorer

Now you’re ready to use steps 5–9 (closing the book in iBooks in between) to continue experimenting with the EPUB’s design or content.

It can occasionally be non-obvious which filename iBooks has assigned to your EPUB. Curious folks will want to play around with some of the other resources exposed in addition to the exploded EPUBs (check out Books.plist).