Announcing Monocle [08032010]
Monocle is an ebook reader. It works in modern web browsers, using standard technologies. It runs in desktop browsers and on mobile devices. It's awesome in Safari and Chrome (the browsers used on iPhone OS and Android devices), increasingly awesome in Firefox, and workable in more standards-fearing browsers like Microsoft's Internet Explorer.
Try it out: http://monocle.inventivelabs.com.au
We've open-sourced it under the MIT licence, which is the most liberal of the mainstream software licences. It can be used by anyone, for private or commercial use, for free (as in speech and as in beer) — as long as they retain the licence information in any copy of the software.
That is, we're giving it away.
Why are we doing this?
We're concerned that the current ebook landscape is dominated by large companies trying to lock publishers, authors and readers into their devices and distribution models. We suspect this might be good for those companies, but no good for everyone else. There's a need to open up these fields to smaller players, and to give the consumer — the person who loves to read books and to 'have' books — better choices.
We expect ebook reading devices to steadily converge with other communication devices. In the past e-readers have been fairly isolated from the network, but as they gain connectivity, consumers will demand better access to the web. Even Amazon's Kindle has stripped-down HTML rendering. Apple's iPad has one of the most advanced browsers around.
The one single platform we expect future e-reading devices to have in common is the web browser. If you want to give your readership the freedom to own (forever) the books they buy from you, the web is where it will happen.
Monocle is unique in providing this functionality. Monocle is also unique in giving publishers and retailers a way to design not only the book's content, but the way it looks and feels too. It's simple at heart, but has enormous flexibility in the way tables of contents, page numbers, running heads, and bookmarks work — even how it feels to 'turn' a page.
Because it's delivered by a web browser, the file format question really doesn't arise. Any text-based format your books' data is in — Monocle can be made to display it. Integrating it with the EPUB standard is straightforward (we've already done it).
Monocle also sidesteps the DRM question, because no files are passed around. If you want to put Monocle behind a paid membership wall, or restrict it to particular devices or IP addresses, that's easy to do. But it's not required by the technology.
If you think Monocle could be an important part of the way you publish digital content, feel free to get some techies exploring Monocle's source code. Or for expert consultation on an e-publishing strategy and workflow with Monocle, drop us a line. You'll find our contact form on the About the Labs page.
Thanks Paul!
In browsers that don't support the column-width CSS
property (notably IE7/8 and Opera at the moment), Monocle runs in
'legacy' mode — displaying a scrolling div for each component in
the text.
If that's not what you're seeing, it'd be great if you could open an issue on Github, furnished with screenshots if possible — or at least the text of that popup.
Blackberry support should land with their new Webkit-based browser — I don't believe there's an ETA on that yet.
The news of your release has made it all the way to the Netherlands (http://www.ereaders.nl/09031001_ebooks_embedden_met_Monocle). Very exiting stuff. Thanks for sharing this with the world.
Quick question (it might be that I saw this somewhere on the pages). How can you maximize screen use on the iPod Touch/iPhone?
Gijsbert - sure, tap on the bookmark (+) button in the toolbar, then tap 'Add to Home Screen'.
Hi, i'm trying to better understand the inner workings but alas i'm not such a good developer: for what i can understand you cannot feed an epub directly to monocle. But if i have an inflated epub how can i use index and chapters information contained in opf files? thanx and keep up the good work. marco
Marco, I recommend looking at augustl's js-epub, which does all the epub unpacking and parsing in JavaScript. From there I believe it should be fairly painless to define a "book data object" as per the Monocle readme.
But as I've said elsewhere, I feel that in many cases the epub unpacking and parsing is a server-side responsibility, because otherwise you're going to hit some performance bumps.
Hello Marco and Congratulation for this work. I have a question. I don't understand how create a book data object dynamically from an epub file. Can you explain me more precisely how do that ? I tried to use the php OPL's EPUB library to create book data object and format the result for mononocle but whitout success? Thank you in advance.
Sorry Joseph ;)
Hello Joseph, I have a problem with synchronous javascript request after htaccess redirect. The html content is correcty load but it is not displayed. Have you a solution to resolve this problem. Thank you in advance.
Finally, I have resolved my problem ;) Best Regards
can anyone tell me how I find the java script so I can use it?
i just want to embed it to a web page
cheers asa
Asa, the Monocle library is not a drop-in solution, it's a way for developers to integrate a book display with any kind of back-end system that can serve the book data. The steps involved in that are described here.
If you're looking for an embed code to paste into some HTML, I'm afraid there's no such thing at this stage. Stay tuned though.
I’d like to use Monocle in some mobile applications. I dropped it into hybrid frameworks such as QuickConnect and PhoneGap. Everything works perfectly except the save state. I’m guessing this is because in the native environment the phone isn’t keeping the cookie.
Any advice to how I could modify that aspect of your reader to work in the applications?
Thank you very much for Monocle!
Hm, that’s interesting — I haven’t tried the wrapper frameworks, and I can’t really imagine why cookies would not behave identically there, unless cookies need to be explicitly enabled for the webview.
But if you do have to modify Monocle to make it work, I would suggest reimplementing PlaceSaver to use HTML5 storage.
Here’s a good place to start.
I’d like to use Monocle in a website, containing an ebook management system. Users should be able to read their own books (stored in .epub formats) with some extra functionality like controlling font size, background colors and so on.
I find Monocle perfect for this task. My only problem is that I don’t know how to use so that I can pass the location of the .epub file and Monocle does the rest. All examples I’ve seen are writing each and every line from the book into the HTML file, which I’ll not be able to do as the files are loaded dynamically from a DB, or whatever storage method we’ll use.
I would highly appreciate your help, it’s really urgent.
Thanks in advance.
Monocle doesn’t work directly with EPUB files, because it’s a bad idea. Client-side JavaScript is generally slow, and particularly on mobile devices. I want Monocle to work really well on mobile devices.
If Monocle worked directly with EPUB files, all the unpacking of the (absurdly complex) EPUB format would have to be done client-side. That means unzipping the package and parsing the three different XML files just to pluck out the subset of data needed to display a page in the book. CPU and memory requirements jump substantially in this situation. And a number of features (such as offline-caching) get signficantly more difficult to implement.
So, my advice is that you build a simple server-side service to extract the EPUB files and deliver them to Monocle in the simple Javascript format it requires.
But you don’t have to do that. You can use August Lilleaas' EPUB-unpacking JavaScript library to do it all client-side if you like — I’d guess the bridge from js-epub to Monocle is probably 20-30 lines of your own code.
See also Blaine Cook’s rePublish, which takes the approach you describe.
I’ve been working on this very solution for months now – but alas I am a novice. I got as far as pulling, parsing, and displaying XML files in a designated format area, but with no pagination or text flow. What you are doing with Monocle is EXACTLY what I set out to do with my website. Cheers to all you are doing and lets keep in touch!
I found Monocle yesterday night and I am impressed. Great Job!!
One question: I want to try it in a project we are working on right now in which we have built some popups within the text (you touch a word and you get a box with a definition/explanation). BUT my interactivity does not work together with page flippers (the page captures the touch/click event). Is it possible to easily capture click events on the page before the flipper does?
Thanks for your great job!!
Mutant: Thanks!
Ernesto: in short, the next drop on Github (a few days away) has a number of features that will make this sort of thing much easier — it’s stuff I’ve been experimenting with too.
I'am researching on monocle code for 2 weeks,and i think the monocle is the best js ebook reader,specially with its paginate function,supporting mutiple language and splicing page perfectly.How the paginate function implemented?Can i get the DOM contents for each page? Thanks for your great work,and the great open source project!

Hello,
Sounds wonderful but when I try it out the popup says it doesn't work with my browser; yet you've written that it works with IE. Also, when available for Blackberry.
Aside from that I think that your attitude regarding ebooks is truly commendable and I hope that everyone in the WORLD will adopt monocle (especially once it works...).
Would like to link to your site, with working examples, from my blog, and embed your reader for others to use. I'd like to help/do my very little bit to get the word (and the work) out.
Regards,
Paul