-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authors’ issues, how Reading Systems could help, and how to implement helpers? #1
Comments
This sounds similar to the suggestion I made to IDPF back when they were soliciting suggestions for the next revision of the epub spec: w3c/epub-specs#672 @JayPanoz you got involved there too. My thoughts are basically in that post. The crux of the problem, and the reason why device-specific hacks exist, is because there is not standard required CSS baseline for reading systems. Thus each one implements its own baseline. Since epubs are "frozen in time" at distribution, that leaves authors stuck with putting in as many hacks as they can to get their single epub looking nice on the widest variety of ereaders. This is the exact same problem we see in the modern web, which developers mitigate by using a normalize.css stylesheet. These days the problem isn't as bad as it used to be, since browsers are starting to converge in their default stylesheets, but it's still there. IMHO this is probably solved the easiest by making it a requirement that all reading systems conforming to the spec implement a baseline CSS stylesheet, and leave it to the ebook to style the rest. The baseline can be cascaded over by author styles, and reading systems can reserve some small number of properties to ultimately override, like As far as what to put in the stylesheet, I think the HTML5 recommended stylesheet is a perfectly good choice for that. Since print and ebooks can have such wildly differing style and layout, it'd be futile to try to think of some alternate "perfect book stylesheet" to pick as an alternative. It's not as important to decide what goes in the stylesheet, as it is getting everyone on board to pick some single common default. That approach would basically mimic what web browsers have been doing for many years--which makes sense because what is an ereader but a web browser with no scrollbar--but we have the head start of being able to reflect on the various issues the web has had to solve during its growing pains. |
Thanks for your feedback, and you’re right, I was indeed involved. To clarify, I’m talking EPUB 2/3 stuff here, trying to find some specific compromise for these two versions of the format, because there is a short term (EPUB) and a longer term (Web Publications). @HadrienGardeur can give more details about EPUB4/(P)WP but the basic idea, since we’ve discussed it lately, is having a super lightweight layer not interfering with authors’ CSS. I guess it would make more sense to discuss the longer term on this dedicated issue. As for the shorter term, I’m just trying to be pragmatic. I’m an author (turned “RS implementer”) myself and any progress is significant. Authors have expectations we can’t really break for EPUB but there’s a possibility we can make it more a little bit more comfortable to them when it comes to recurring issues. |
Yeah if we're just talking about some kind of compromise between a new reading system that wants to implement epub2/3, then I don't think we're going to get anywhere with that. IMHO the standard is both too complex and too lax, and bad epub authors have released too many bad epubs for us to bother with trying to massage things further. Personally I think this issue can only be fruitful if we're discussing a new version of the standard, where we can simplify a lot of the cruft and enshrine new requirements and baselines, and then educate epub authors on best practices. But for epub2/3, with its curse of distributed files being "frozen in time" and not updateable like web pages over http are, it's way too little, too late :) |
OK, have thought about if for a while and I can at least clarify my own ideas. The thing is the current page margins’ implementation (see issue #2) brings a lot of flexibility at the RS level and could allow for interesting layouts. This implementation is still hypothetical though, I must stress-test in the next weeks and see if we can indeed use it or apply all margins at the web view level. Anyways, it opens up new possibilities which aren’t currently covered. I’m not saying we should spec stuff at all, I just believe that it would at least be interesting to discuss them and maybe experiment with it if there is a visible incentive and technical possibility to do it. Now, until Houdini becomes a real thing you can use in production, I can’t see stuff added to CSS going anywhere. Supporting those values/props implies performance issues. And considering the average (Android) smartphone is going cheaper, our performance budget will stay pretty limited for a while (so much that I’ve already planned to investigate performance optimizations we can get via the new CSS specs Chrome is promoting e.g. CSS containment, In other words, I consider this is a long term issue for various reasons. In the meantime, I’d like to explore what you could call “CSS Author’s Intents.” The following is of course a simplistic abstract but:
In other words, RS have information authors doesn’t have, they can theoretically help authors do some things e.g. invert transparent PNG/SVG in night mode, do bleeds, put page numbers in margins, display footnotes (which is already being done automatically based on the How a “CSS Author’s Intent” could help, you may ask?
Of course, I’m taking the W3C’s priority of constituencies into account and, well, it seems clear to me authors and implementers playing cat and mouse won’t help users in any way. It is also worth mentioning that with Reader Modes in web browsers, especially as some browsers are willing to push them (cf. Safari in High Sierra), UAs now share some issues with ePublications (images management in night modes is an obvious one). Currently, they’re ignoring CSS and JS entirely but it has side effects which can hurt user experience e.g. having icons displayed at 100% of the container’s width. As far as I’m concerned, I can design mechanisms at the CSS level if there is a class or an attribute in HTML so that shouldn’t create extra work at the JS/Swift/etc. level. I’d much prefer an attribute so that there is no collision with classes though. But what’s important is that I can kickstart experiments during dev/testing to see if 1. it can work and 2. it can be useful in practice. I need authors’ feedback though. Here are some examples I’ve been experimenting with our current pagination implementation, maybe it can give you ideas (pinging @dauwhe as there’s almost an Edge-to-edge header background. Edge-to-edge image. Image bleed which doesn’t block text. Once again, it’s hypothetical, I can’t make any promise, there is a lot of different factors to take into account at the RS level, but if we don’t discuss, experiment and beta-test it, we won’t know. |
I'm not sure if adding a new "author's intent" The problems are that (and I know you know this, I'm just putting out in the interest of public discussion):
So as far as an "author's intent" attribute goes (if I'm understanding it correctly), I suspect that it would wind up being more complexity that RS's will ignore, and that authors won't know/won't care how to use because they already don't care about semantics, or they use an epub creation program that can only apply super complex styles to an unsemantic DOM. Better, I think, to embrace the rich vocabulary HTML5 and epub already give us, and to simplify the spec so that authors don't feel the need to rely on epub creation programs. |
Well, actually no, I don’t know the authors’ intent from the markup. Take
Please note the “The element can thus be used to annotate illustrations, diagrams, photos, code listings, etc.” This interesting note also
In the examples you’ll find some use cases:
I can add some use cases as well:
So to sum up, I have edge cases for high contrast mode, invert, sizing, whitespace, etc. all over the place because Styles-wise, it can be floated, it can be full-bleed, it can be a grid, it can be a slider, it can have a background-color to make it clear it is self-contained (night mode), or be using an icon system for some reason (night mode, user settings), it can use an embedded font I should not override, or use syntax coloring for code, and so on and so forth. Enters ARIA, which is kind of an authors’ intent by the way, schemas, etc. and I have an awful lot of combinations to manage, will quite probably create additional bugs as a consequence, it will become unmaintainable at the RS level because you also have to take reading modes and user settings into account, it will turn into a nightmare then a failure because it’s so much debt, and we’re back to square one. More importantly, like I said, it’s just about exploring such a mechanism, because you need to prove there are use cases for stuff to have a chance of becoming standard. Please consider the W3C model, we moved away from the IDPF model months ago and this has several meaningful impacts about standardization—in some cases, you might even be asked to prove it can done with what’s already available, and not something designed in isolation, requiring what wasn’t implemented or doesn’t exist yet; webkit implemented ARIA doc roles weeks after the spec/mapping publication, they didn’t bother implementing Finally, Readium 2 will not only be about EPUB2/EPUB3, it was designed to deal with what comes next. And you will very likely encounter some of those issues again in the future, in browsers (reader mode, browsers settings, etc. are features browsers vendors certainly won’t disable because you ask them to). Am just trying to be pragmatic, for all those reasons. And the more I can work on during dev/prototype, the more we’ll learn how to manage issues in future specs. In case it was not clear, a large part of my work is about collecting feedback, discussing current issues and possibilities with CSS authors, and document quite possibly everything CSS-related. So, there’s also a long-term aspect to my mission. Also, for the record, the EPUB 3.1 spec allows the creation of custom attributes. I’m not even talking XHTML custom attributes there, just HTML5 custom-attributes for the sake of R&D during dev. “First do it, then do it well.” (in that case, my goal is just checking whether it’s possible and realistic or not.) |
Sure, that's true. But that's what An RS doesn't have to support every possible semantic suggestion ever, just the big common ones. Like we were discussing for night mode on the SE mailing list for example--our current solution is to add a custom color depth So if we were to add yet another attribute to indicate author semantics, we'd wind up with something like |
Well, this is where our views are differing, I guess. To sum up:
So, if you want something to be future proof, forget designing it around [edit] To be clear, I am not trying to discuss how it should be done there, but collect a list of issues authors have had so that I can document them and we can think about it. Custom data attributes are not the way to go. At all.
It’s just that it’s the easiest solution to experiment during dev. All I know is there is a discussion about |
Heh, the link in your first bullet point is super incorrect; you can select It doesn't really matter how you write the Anyway, good discussion here, thanks for letting me talk out loud about this. I think in the end I'm more interested in working on the spec end of the solution, than the RS end; and after some thought, possibly the secret sauce that's missing from the whole long epub saga is that maybe there wasn't a tight enough coupling between spec writers and RS implementors, like there is at W3C. But that's a political problem, not one we can solve by chatting on Github :) |
If content is served as HTML5 (and not XHTML5), you indeed have to escape the colon in CSS and JS (with Also, if Tab Atkins trolled Brad (see tweet at the middle of the article) instead of correcting him, you can be sure this is correct. I’ll let you check Tab Atkins’ pedigree, but can say he knows a little about CSS. |
Hey, if Brad wants to serve XHTML as HTML5, a different and looser standard, then all bets are off and that's his problem. But he can't complain if he wants to do that. That's like complaining that Python served as application/javascript isn't working in the browser. You can definitely select XML namespaces in CSS (using the Whether epub should be XHTML or HTML5 is a discussion for another day and a problem for the standards body du jour, but today's standard says XHTML so that's what we have to frame it as. One can't complain if one buys cookie dough and it doesn't bake when put in a blender instead of the oven. :) |
Yeah but you might want to take into account that the newest Kindle format serves contents as HTML, have had a nasty surprise a few weeks ago. |
For the sake of completeness, as regards the “how to ‘spec’ it?”, which was way outside the scope of the issue (authors’ issues listing, public API, etc.).
Can we now turn to practical issues, please? The most important thing we need to kickstart this is a list of use cases. Without use cases, it’s not even worth considering how this should be spec’d—which would be out of scope for this project anyway (I can only document issues, solutions we tried, drawbacks, etc. so that it can serve as a reference). |
My work tends more to stylistic overview and less to the technical (I'm a designer, rather than an engineer) but I do think that the move to WC3 does not preclude the unique position an epub (book) has. The differences that exist (whether overtly understood or not) between books and websites, regardless of markup, is a fundamental, underlying, philosophical condition of the way forward in developing spec and standards. What my research has taught me is that what is most deficient about epub authoring is the tendency to 'replicate' a print book: serif typefaces, small and closely leaded, tight pagination (large loads) rather than to 'understand' from a design perspective what a digital book actually is, can be and can become. Some of the things that are being discussed have far-reaching implications and there is a priority-scale. For example, whether an image reverses in night-mode is probably not as important as whether the RSs can actually support the 'alt' attribute in a TTS rendition of the text. |
Hum, I think nobody said that? Personally, I just said that I’d be better off not relying on anything XHTML because WP, PWP can’t be XHTML-only and EPUB4 will probably lessen requirements (HTML is back). So having anything built on XHTML is not future-proof.
To be transparent, your scale and mine can’t be the same i.e. I have constraints and scope to factor in. Basically, here’s my decision path, which makes the concept of priority very loose:
When it comes to inverting images in night mode:
When it comes to alt
I mean, there is a lot of feedbacks and requests I must either report on the Readium 2 or Readium Desktop repositories because the answer to “can it be implemented in pure CSS?” is “No.” Discussing some sort of API wasn’t even planned, I’m doing it in my free time. You know, there is nothing preventing Reading System X to feed a neural network with all your EPUB images to check whether they should be inverted or not. Google is already doing it for speech bubbles in comics. But then Reading System X may use its own stuff, you’ll probably get false positives, it won’t be documented at all so you won’t be able to correct that. Only Reading System X will benefit, it might become a competitive advantage so Reading System Y implements it as well, with it own stuff too. In the end, there is no interoperability at all, spec comes years later, RS X and Y don’t bother porting their own stuff to spec, it complicates authoring a little bit more, it’s a lose-lose situation for everyone. FYI, my top priority is designing a reliable and solid CSS system. The situation is getting worse: a lot of the latest Reading Systems resolve to inline styles and My biggest concern at first was implementers: “will they be willing to implement it, should I design it so that it’s super easy to manage?” My biggest concern now is wondering whether it’s even useful discussing this and if I’d not better let the Personalization Task Force deal with it without the requests I can get. Problem is, if you don’t have prototypes and stuff, you don’t know how hard it will be to implement (which is also why a lot of EPUB3 specs were not). |
Please also note this is a problem for gaiji (cf. issue #7) but it is a lot easier to solve because there is a japanese EPUB profile which makes use of CSS classes. In latin, there is simply no profile; everyone can style things, sometimes in unpredictable ways for the Reading System. |
Thanks for comprehensive analysis of your important work. I merely put out these thoughts in the hope that the people with strings to pull will pull the ones that make most sense, in the long run, for the 500+ year-long tradition in book creation.
ruth tait
… On Jul 29, 2017, at 5:21 AM, Jiminy Panoz ***@***.***> wrote:
Please also note this is a problem for gaiji (cf. issue #7 <#7>) but it is a lot easier to solve because there is a japanese EPUB profile which makes use of CSS classes. In latin, there is simply not profile, everyone can style things, sometimes in unpredictable ways for the Reading System.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#1 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AMwGgBZ62qQF7e5K8QmdLCU_KNk67c1Mks5sSvmBgaJpZM4OMle->.
|
Given the project’s progress, and our plans to move forward, I’ll close the issue (could be re-opened at some point, if needed). Issues and requests have indeed been mainly collected outside of this github issue and a recap is available in issue #17. So if you want to add any issue to this list, go ahead, especially as it is referenced in the EPUB 3 Community Group’s repo. Besides, this discussion turned super technical at some point (so much that I decided to rename it) and since User Agent Properties are now a thing in CSS, there is no reason to talk any longer about custom and Please bear in mind we don’t have User Agent Properties yet, we only have Reading System variables – which happen to be exposed to authors –, and their prefixes can be changed at implementers’ will. So don’t rely too much on them and hope your styles will work in all implementations of Readium CSS. Thanks for your feedbacks. |
Warning: this is a debatable issue for which we MUST get feedback from both implementers and authors.
[This original message was edited with the following TLDR for clarification. It will also be easier to keep track of issues this way]
TLDR
Scope
The aim of this issue is to list common issues CSS authors have had to deal with. It is not strictly scoped to Readium CSS since I will document those issues so that could also serve as a reference for the upcoming specs.
At the moment, we’re very far away from discussing “how it should be done.” The idea is to explore whether “it can be done.” This will probably require prototyping and beta-testing in ways which are not 100% standards-compliant but beta-testing will also be documented so that the maximum amount of information can be made available.
Also, it’s worth repeating that two important changes were made in the EPUB 3.1 revision:
We have to take that into account, which is why I’ll be referring to the HTML design principles for the sake of anticipation.
Most use cases will probably be about styling since I’m dealing with CSS there (there could be interactive use cases as well, but that’s out of this project’s scope). This has a lot of implications, the major one being it should not be markup territory.
What is critical is a list of use cases. So let’s focus on that at first. There may well be use cases interesting to the web platform, so “how it should be done” is extremely conditional (e.g. use cases fit for ARIA or specific media queries because they are a11y-related).
Use cases
Original Message
While documenting the wiki, I came across nasty hacks which I’d personally like to prevent if possible.
And so on and so forth.
Worst-case scenario: it becomes a technical debt on the RS side.
Best-case scenario: it stops working at some point and authors will update their files.
Real-case scenario: it becomes a technical debt on the RS side if hacks’ usage is significant, authors don’t update their files, a minor update introduces regressions, nobody’s happy.
I guess we could acknowledge there are issues for which we definitely need authors’ help. It could be seen as some kind of “help us help you” mechanism. After all, the more hacks authors will create, the more issues we’ll have when it comes to reading modes and user settings.
For instance, we could imagine something like:
In which
data-readind-mode="adapt"
("adapt" is there because XHTML but we can make it boolean) automatically inverts or “sepiaes” the image with a CSS filter, depending on the current reading mode selected by the user.If
epub:type="noteref|footnote
+ popup is any clue, authors are likely to use such a mechanism if they can benefit from it.In that case, we must reserve styling and make it clear it’s the RS’ responsibility to deal with it, not the authors’. And use super-specific selectors so that it has no effect on other elements.
Considering the image example, implementers might choose darker or lighter shades for some modes and will have to fine-tune filters accordingly, so that the background colors are exactly the same.
Of course there are probably other cases, and managing it entirely through CSS will make it more maintainable, updatable and portable (for other SDKs).
Custom attributes will be EPUB3-only though. But this is already the case for
epub:type
so, as far as I’m concerned, it’s not an issue. It’s whether we consider it presentation (classes) or behavior (custom attributes).Sure, there are alternate stylesheets but support has been so rare that very few people have used it. And they are not likely to use it if other major RSs don’t support it, so I’m trying to be pragmatic here.
If we decide to provide such an “API”, question is do we design it as some kind of standard in disguise other SDKs can use, especially as authoring tools’ implementation is another issue to consider. It’s high time we tackle those issues, especially as implems might drive standards, w3c-style.
I’d like implementers and authors to discuss this, because I feel it’s a critical issue for which we have to find compromises sooner than later. It could also be of interest to browser vendors for reading modes (Safari, Pocket & al.) since authors might require such mechanism at some point.
Also, if you’re an author, please feel free to list problematic issues related to such a public API.
The text was updated successfully, but these errors were encountered: