March 31, 2011
Converting an O’Reilly iOS app to EPUB

I am currently learning Ruby on Rails1. Instead of diving right into Rails, I decided to learn the fundamentals of Ruby first by reading The Ruby Programming Language from O’Reilly2. Doing a bit of comparison shopping showed that purchasing the book as an iOS app3 was the best deal at $6.99.

I downloaded the app and started reading and this is what I saw:

Nasty code truncation

Umm…completely unacceptable for a programming book. Since the app uses Stanza underneath the hood, I decided to crack open the package4 to see what’s going on.

mkdir ~/ruby_book
cp ~/Music/iTunes/"iTunes Media/Mobile Applications/Prog Lang 1.0.ipa" ~/ruby_book
cd ruby_book
unzip "Prog Lang 1.0.ipa"

Digging around revealed the Open Publication Structure5. Some Googling quickly led me to Bob DuCharme’s blog entry6 about the proper way to create an EPUB file.

cd "Payload/Prog Lang.app/book/"
zip -q0X "The Ruby Programming Language.epub" mimetype
zip -qXr9D "The Ruby Programming Language.epub" *

Voilà, our very own EPUB book that can be viewed using iBooks:

Happy iBooks

11:12pm
(View comments  
Filed under: iOS EPUB 
  1. mintyfresh posted this
Blog comments powered by Disqus