-
Notifications
You must be signed in to change notification settings - Fork 198
EPUB and other package formats
Monocle is designed to be format-agnostic. This means you have to do a bit of work to get it to support a given ebook package format, like EPUB, MOBI, Zhook, etc.
The reason for this is not philosophical. We'd love to save you the work. The reason is practical: removing the packaging of an ebook (typically by unzipping it) and then parsing its internal structure is way too slow and wasteful of resources to be performed client-side. This is more than ever the case with low-specification mobile devices. Those devices are key target platforms for Monocle.
If you want to go ahead regardless, serving EPUB files to the client for extraction, @augustl has created a JavaScript library for processing EPUBs called js-epub. You just have to write a simple book data object bridge between Monocle and js-epub. We don't know if anyone has done this yet; let us know if you do!
Otherwise, it's expected that you're pre-processing EPUB files on the server-side and gathering the raw data needed to define a book data object. There's a bunch of libraries that exist to do this sort of thing in various languages. If you're using Ruby, take a look at Peregrin.
Well, all of the above still applies. If you identify a point of incompatibility, please lodge an issue in the Monocle bug tracker.
But be aware that EPUB3 is a deeply problematic specification. "Scripted documents" introduce serious problems of security and user interface conflict that Monocle is unable to mitigate, sadly. We generally advise you to strip JavaScript from all components before loading them. More discussion in Issue 40 and at blog.booki.sh.