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