How to handle non-linear resources in the EPUB/HTML navigator? #143
Replies: 20 comments
-
I don't think it's possible at the moment, since as you noticed Technically we could also load the document if it's listed under Maybe we could talk about that on the next Readium call this Wednesday, if you're willing to join. See Weekly Meetings here. Do you have a legal EPUB that we could use to test this? |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for the quick response. Unfortunately, I don't know exactly how the other platforms are handling it. I am by no means an Android dev, but this local I'm including a .zip EPUB sample where we'd hoped to have the ability to click the hyperlink at the beginning of the EPUB that will load the additional included Orphan Black: The Next Chapter - Our Needs To Shape Us: Part 1.epub.zip Good idea on attending the call--I'll see if I can free up some time to make it. Thanks again, |
Beta Was this translation helpful? Give feedback.
-
If that can help, @mickael-menu, I think (i)Books treats those links as something specific i.e. they are opened in a modal view without all the EPUB-specific stuff such as pagination, user settings, etc. Actually, entire publications may even be designed around this assumption. So they are completely ignored when it comes to pagination, etc., they’re just displayed in a fullscreen modal and provide their own means of navigation. I can provide an EPUB privately if needed. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the sample @kerryknight, I could test with Apple Books on macOS and iOS, and as @JayPanoz described, it's presented as a modal without pagination nor style: This follows a guideline from the spec:
On R2 Kotlin, the non-linear resource is loaded directly in the webview, but then we're stuck because there's no way to go back without a link inside the document, or through the table of contents. Personally I'm not a fan of the modal view, because:
I suggest that:
Alternatively, we could delegate the presentation of non-linear resources to the reading apps altogether, by calling a |
Beta Was this translation helpful? Give feedback.
-
Here's another thread of people trying to use Looks like Readium 1 was supporting this properly. Some interesting notes from this post:
Also, while EPUB 3 readers may have failed these authors, we're supposed to be format agnostic in the navigator, so we can set a new precedent for webpub formats. |
Beta Was this translation helpful? Give feedback.
-
I agree with the previous comments about the opportunity to allow a proper implementation of non-linear fictions. This topic is UX oriented, i.e. joins authoring and reading system issues about presentation / navigation. It will be interesting to submit it to the W3C EPUB3 CG (soon W3C Publishing CG), as the current EPUB3 specification is clearly underspecified about the non-linear items and the discussion applies to Web Publications as well. This community can therefore model what a non-linear fiction is and decide its practical characteristics (FXL/reflow resources, pagination/no, mandatory navigation links inside resources vs automatic navigation via path history, memory of the last position ...). |
Beta Was this translation helpful? Give feedback.
-
IMO this covers multiple questions that we need to ask ourselves:
My personal take on this would be:
|
Beta Was this translation helpful? Give feedback.
-
@HadrienGardeur I agree that resources inside the bounds of a publication should have a specific treatment. IMO it should be true for any input format which is able to differentiate between what is inside and what is outside. EPUB is capable of that, WPUB and RWPM also have this notion because we explicitly defined |
Beta Was this translation helpful? Give feedback.
-
@llemeurfr sure, the following things are specific to EPUB though:
|
Beta Was this translation helpful? Give feedback.
-
It implicitly exists though, through hyperlinks in HTML resources, or the table of contents for other formats such as audiobook. So we're faced with the same question: what happens when the user jumps from the ToC to an audio file that is not part of the reading order? This also brings up some questions about the UX in reading apps: should the progress bar / page numbers be hidden when reading/playing a non-linear item? |
Beta Was this translation helpful? Give feedback.
-
Yeah I have a few examples I can share – will try to do that via Slack today as I must retrieve these EPUBs first. But what I can say is that at some point, at least in France, I guess you can say this use case is more of a work around, as there is no such thing as “give me a blank page” in EPUB, but EPUB was also the only reliable way for these publishers to make some money. So that also made them iBooks’ exclusives in a way, given it was one of the very few but probably the biggest implementation of Which brings me to another use case I’m aware of: a ready to use modal where you can manage “widgets” e.g. image galeries, interactive maps, etc. more easily. Pagination across RSs makes it incredibly hard to implement a modal yourself so it’s fair to say authors will try to leverage what already exists. But once again, this use case kinda works because this So on top of these “hacks” I guess there may well be vastly different use cases. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the details Jiminy, it looks like we opened a can of worms... :/ |
Beta Was this translation helpful? Give feedback.
-
Wow, thanks @mickael-menu, et al. I'd never intended/expected this use case to garner this type of attention. To give you a bit of more context on our use case, we produce our own content at my company and we're just now making the transition to utilizing EPUB3 from a standard HTML implementation. Currently, we have no plans to distribute our EPUB content outside our own platform (meaning our use case is not a standard one for Readium usage), so we're able to work around some of the aforementioned issues with our own set of hacks. At present, we've had to utilize a native solution for the non-linear resource hyperlink where we capture the webview request url (which was skipped by Readium due to its lack of inclusion in As for the "Should these modally-loaded, non-linear resources only scroll vertically or should they paginate?" argument goes, our special use case is completely fine with a standard vertical scroll only. However, if support were added out of the box, I could completely see us progressing further to JayPanoz' idea:
Thanks again, all! |
Beta Was this translation helpful? Give feedback.
-
We've lived through the pains of upgrading private forks with Readium 1, so if we can provide a way to implement that kind of features without having you resorting to hacks, that would be best. Either as an extension point, or out of the box. So maybe we need a way to declare what kind of presentation is expected for a non-linear resource (see this issue), to fit different use-cases: inline+paginated for text adventures, modal+scrollable for widgets. To avoid breaking existing books using non-linear as modals with EPUB, but still work with non-linear fictions, we could:
An author could always embed a RWPM inside an EPUB to override presentation hints to enable pagination and CSS styles in a non-linear resource, for example. (Which makes me think that a tool to generate/synchronize a RWPM from an OPF could be useful to authors) |
Beta Was this translation helpful? Give feedback.
-
We talked a bit more about this issue during last week's meeting. We agreed on:
For the rendering of non-linear resources, the discussion we had on this related issue about footnotes can give us some clues. The Navigator should have the simplest implementation – and in this case, also the correct one in my opinion: navigating to the non-linear resource in the main web view, like any resource. This will fire a However, we can add a hook to allow reading apps to intercept this navigation, e.g.
Since in this case the Navigator won't navigate to the non-linear resource, then the last location stays the one from the current linear resource, which is compatible with iBooks' behavior. |
Beta Was this translation helpful? Give feedback.
-
Here's a slide from the results of W3C EPUB Survey, which brings some light on this feature:
|
Beta Was this translation helpful? Give feedback.
-
Many good observations and analysis in this thread, just adding my own comments (copied from Slack). Sorry about the conversational style, I don’t have time to redact this properly tonight :) in Readium1 we implemented support for non-linear spine items by displaying them just like any other HTML resources ... but the logic was incomplete because of "forking" from linear into ancillary resources was not handled properly, for example jumping back into linear reading order, previous/next navigation history, etc. (also, TTS and Media Overlays playback ... several ramifications) |
Beta Was this translation helpful? Give feedback.
-
See also: Best place to reignite this can of worms :) |
Beta Was this translation helpful? Give feedback.
-
Thanks for sharing your experience @danielweck,
Seems like reading app concern to me, but we can certainly provide best practices. A documentation addressing this would be useful. I think that showing a "back" history icon is probably the most common way of doing this, and useful beyond this particular use case. It would also work with non-linear fictions because not too intrusive (e.g. paginating back to the next linear item at the end of the non-linear resource would break such fictions).
That can prove challenging... Assuming the publication is properly designed, there's a link in the non-linear resource to go somewhere else, or a table of contents to jump to another resource. But in the reading app, I can think of two ways of addressing this:
Nice! Thanks for sharing |
Beta Was this translation helpful? Give feedback.
-
A related issue with a sample book was opened by @civodulab on the Kotlin repo: readium/kotlin-toolkit#124 |
Beta Was this translation helpful? Give feedback.
-
Edit from @mickael-menu: This discussion (below) originally started on r2-navigator-swift, but soon broadened into a global conversation about the way Readium 2 should handle non-linear resources across platforms. Hence the transfer to architecture.
Hi! Thanks again for the great project and all your hard work!
I have what is hopefully a quick question: Is there a way to navigate to a non-linear TOC item?
SCENARIO:
I have a hyperlink in my main epub body that I want to tap to take me to an additional xhtml non-linear resource (
item_body_previously_on
idref listed below). This item is included in the EPUB table of contents. However, I can't figure out how to make this occur properly as the non-linear resource is getting skipped over when creating the publication'sreadingOrder
and checking the publication'sreadingOrder
seems to basically be at the root of every navigation interaction.This functionality does not seem to work in
r2-testapp-swift
when I import my epub there as a test, either. However, the hyperlink does function correctly onr2-navigator-kotlin
as well as when I import into Apple Books, so I don't think there's an issue with my epub itself. I have tried manually adding an additionalLocator
object for the non-linear resource to my publication'spositionList
to no avail.Any quick advice or ideas on how I might be able to reach my desired functionality?
As the non-linear resource is in the publication's TOC, I've tried this below but with no success; it still skips over the resource on link clicks:
Any and all advice is greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions