Use case: the tweetable ebook

186 views
Skip to first unread message

Eric Hellman

unread,
Feb 3, 2014, 3:51:16 PM2/3/14
to epu...@googlegroups.com
One of our authors requested a neat feature that could be deliverable by epub.js without a lot of work.

She wanted to be able to tweet a location within a book so that someone clicking on the link in the tweet gets delivered to the same location within the book. Now, as far as I'm aware, you can't really do this in any reading platform; you can do it within some platform, but not so that anyone on twitter can follow your link.

Does this make sense?

Eric

Tyler Mulligan

unread,
Mar 24, 2014, 6:24:21 PM3/24/14
to epu...@googlegroups.com
I believe you're talking about a Canonical Fragment Identifier (CFI). If you view the source of the first chapter in the Moby Dick example using the inspector in your browser's developer tools, you can see these in action, "c001s0001," is the id of the first sound clip, for example.

Because epub.js is wrapping the book, and delivering it within an iframe, I cannot link you to that chapter directly through the demo, which is essentially what you want to do if I understand your problem correctly.

However, I can demonstrate using the id as an inline anchor link by linking directly to the xhtml file of Chapter 1 in the unzipped epub book in, referencing Page 16 with a CFI after the the hash symbol ( http://fchasen.github.io/epub.js/demo/moby-dick/OPS/chapter_001.xhtml#c001p0016 ).

What you need then, is a method to pass this CFI to the iframe epub.js creates.

Hope this helps,

- Tyler

Morbus Iff

unread,
Mar 30, 2014, 9:20:36 AM3/30/14
to epu...@googlegroups.com
[These links will stop working by July 2014.]

The now-dead Readmill *kinda* did this. Not really. OK. Not at all.

Here's an example:


The way Readmill stored the location of highlights is implied here:


You'll see a "position: 0.25" in there. That's actually the *percentage* of the book near where the quote appears. See, Readmill tried very hard to merge down multiple renditions of the same book into one master work (if you know FRBR, they attempted to take all the various Manifestations of a Work's Expression and merge them together, or: they attempted to take all the various releases, re-releases, ISBNs, digital formats of the A Game of Thrones "novel" and merge them down into one "book"), so that the community would be sharing one master-read together. For example, lots of different Manifestations of https://readmill.com/books/a-game-of-thrones were merged together to create that master display of shared community highlights. I *think* this is an improvement on how Kindle does it, where the locations are much more tied toward the particular Manifestation you're reading. It is also much more forgiving for "ebook version 2.1" or "with author commentary!" re-releases/updates.

The interesting thing is there's some magical Readmill code that takes the highlight and position and magically makes it possible to see it in inline when you're reading the book, even if you're reading a different Manifestation of the original highlighter's. I suspect they're taking the percentage of the highlight, searching to that point in the current ebook, adding/minusing 5%, and then searching for the highlighted bit of text (or, at least, that would be MY first stab at an implementation). This would potentially fail on rather short highlights (such as "She died", which would be disastrous if the app linked to a spoiled "She died for real this time" vs. an earlier "She died laughing.") but for longer highlights, such as the one above, would probably work pretty well.

-- 
Morbus Iff ( you are nothing without your robot car, NOTHING! )
http://www.disobey.com/ and http://www.disobey.com/wiki/
twitter: @morbusiff / skype: morbusiff / irc.freenode.net, Morbus
An O'Reilly author and blogger: http://www.oreillynet.com/pub/au/779

Eric Hellman

unread,
Mar 31, 2014, 2:34:25 PM3/31/14
to Morbus Iff, epu...@googlegroups.com
The cross-edition position marker is a neat trick, but I’d be fine just having the capability in ONE edition. That I specify. 


--
You received this message because you are subscribed to the Google Groups "epubjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to epubjs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages