Rick Gordon has long touted his method of editing EPUB files right in a jail-broken iPad. But I've been too chicken. But I am finally getting caught up with some reading I needed to do and found this great article by Keith Fahlgren over on the ThreePress blog (which you should definitely also follow, if you're into EPUB). The article explains how to use the iPhone Explorer program to access the XHTML and CSS files on your iPad to facilitate updating EPUBs. And it's awesome.
Digging around a bit, I found that Macroplant, the folks who wrote iPhone Explorer, also created a little program called Phone Disk, that usually costs $10 but is free until December 1. It's even better than iPhone Explorer. What it does is show you the contents of your iPad (or iPhone or iPod) as if it were any other external drive. Check this out:
You'll notice that there is a Books folder inside the iPad (mine's ambitiously called, “Firstpad”) and that within the Books folder are a series of folders with cryptic names, all ending in .epub. Although you can open up the Books.list file to see which cryptic code is related to the book you're interested in, I find it faster to list the books by Date Modified. That way, the one that I'm working on is always at the very top.
According to Macroplant, you should be able to double-click on a file and open it, and that works for
me with XHTML and CSS with TextEdit, but curiously not with BBEdit, my editing tool of choice, which acts like it's hung before recovering and showing you the file, making it too slow to be useful.
Thankfully, the folks at Barebones gave me a solution. They say that BBEdit looks like it's hanging because it's checking for a few files, and that on a remote file system like the iPad, it takes a longer time. To fool BBEdit into not worrying about where it is, you have to create two empty text files, "bbedit.bbeditSettings" and "tags", and place them in the EPUB folder whose book you want to edit. Now when you click an XHTML or CSS file, it'll open right away in BBEdit.
After you make and save changes in the XHTML file (or CSS), you'll need to close and reopen the book on the iPad to see how the changes look. But this is nothing compared to rezipping, dragging, waiting for it to sync, opening it back up again and so on. It will save you a lot of time.
When you're done testing and adjusting your EPUB file, you need a way to get it out of the iPad so you can distribute it. First, be sure to eliminate both of the BBEdit files that we added. I like to drag them out to the Books level so I'll have them for the next book I'm working on. Then, delete the iTunesMetadata.plist file (which Apple annoyingly adds to your EPUB) as well. It seems like you should then be able to sync the iPad with your Mac via iTunes and then drag the EPUB file out to your desktop but I haven't been able to get that to work (the newer EPUB from the iPad doesn't ever get to the iTunes library).
Instead, still using Phone Disk, drag the entire EPUB folder from the iPad out onto the desktop, and then zip it back up with Terminal. (You remembered to delete the special BBEdit files and the iTunes Metadata file, right?)
Being able to make edits directly to your EPUB on the iPad (or an iPhone) is a huge time saver. Thanks, Keith, for getting me started on this.