-
Notifications
You must be signed in to change notification settings - Fork 128
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
Proposal to rework drama to not use tables #780
Comments
Good work. I think Using We could even avoid the extra classes by selecting However I suspect that In any case, any solution we select has to work in ADE. |
I think even if none of this shakes out, we should at least add |
I guess the next step would be to test on a physical Kindle? If you (or anyone else reading) has one I’ve attached my reworked |
Can you send the compatible epub version that I can try sending to my Kobo? |
Certainly. Here’s the compatible and Kobo variants. |
Here are some screenshots of assorted pages from an aging Kindle Paperwhite (Kindle firmware 5.6.1.1): https://photos.app.goo.gl/4C85aEA4MSxUsGj97 If any other pages or perhaps text size views would be useful just let me know. This is just at the text size and preferences I had from last reading a book. |
OK, I tried it on my very old Kindle Voyage and Kobo Aura One and they both look good. Lastly I think we should try the renderers on some of the bigger ereading apps. Google Books, Kindle app (not the same renderer as the eink Kindle), Nook app, Moon+, FBreader. (FBreader I recall has an especially bad renderer so I'm not super concerned if it doesn't look perfect in that one.) |
OK looks good. The next question is, how would we handle the @EmmaSweeney do you have any thoughts on this proposal? |
But what about multiple speakers together in one dialog? We used |
Right, yes. Let me have a think about how to handle that. In the mean time, I’ve started a branch with a |
I'm happy that we are improving the reading experience for our plays! I don't think there is anything besides the |
The Next up: rowspans. |
Sorry, didn’t see your question @EmmaSweeney. I just tested on Unnatural Death and it works fine. (Incidentally I‘ve been listening to a pretty good radio adaptation of that for the last couple of days 🙂) |
To set the scene for Obviously we can’t use My initial suggestion is to move to a single row, with the first “cell” div containing multiple <div class="drama-row together">
<div class="drama-cell">
<b epub:type="z3998:persona">Sarah</b>
<b epub:type="z3998:persona">Lady Britomart</b>
<b epub:type="z3998:persona">Barbara</b>
<b epub:type="z3998:persona">Stephen</b>
</div>
<div class="drama-cell">Confession!</div>
</div> I’ve left the existing .drama-row.together .drama-cell:first-child [epub|type~="z3998:persona"] {
display: block;
text-align: right;
} This results in this rendering, which is pixel perfect to the current: ![]() As a first stab, how does this approach sound? |
OK, I think that looks reasonable. Shouldn't a persona cell have Additionally, maybe we can use |
All good points. The current default drama styling has: [epub|type~="z3998:drama"] td[epub|type~="z3998:persona"]{
hyphens: none;
-epub-hyphens: none;
text-align: right;
width: 20%;
} My current automatic conversion turns that selector to |
I think we should change the new selector to match |
Let me know if you need help switching the manual's drama section and/or play how-to guide. |
I’m a bit tied up at the moment, will try to get back to this next week. @EmmaSweeney I’m sure I will after we finalise the approach 🙂 |
So I updated the convert-drama to automatically fix The repos are:
|
OK, I’ve updated that branch to remove the markup rowspan conversion code and add a warning that it’ll need to be done manually. @acabal: if you have time could you run a couple of tests with this to see if you’re happy with the output? (The tests are currently failing in actions, but as this is a one-and-done branch that won’t be merged I’m not too worried about that.) |
OK, looks good I think. The last point I would bring up, is do we want the With tables, So we could remove the classes and use the following selectors instead which would be identical: .drama-row{
}
/* becomes... */
.drama-table > div{
}
.drama-cell{
}
/* becomes... */
.drama-table > div > div{
} The upside is that it's less markup, fewer classes for the producer to remember, and less room for error, for example in a copy and paste gone wrong somehow. The downside is that it might be less readable (or maybe more readable since there's less visual clutter?). Might also be harder to find cells using plain text search, and would result in longer xpaths in Personally I think not using classes is more in line with the general SE philosophy, and in this case the equivalent selectors are basic and straightforward. But I could could be convinced otherwise. |
I avoid drama like the plague so my voice doesn't count for much, but I would argue plain divs is much less readable, and understandable. In this case, I think there's benefit to making the HTML provide clarity, over and above just giving something for the CSS to target. |
Sorry, it’s been a seriously stressful week at work and I’m back in the UK for a few days to visit a sick relative, so this is on hold. I’ll pick it up again in the next few days hopefully. |
No rush, take your time! |
We currently use tables to lay out drama, but this is problematic:
We’ve attempted to work past the first problem in the past with CSS that disallows clicking on tables, but this has the side effects of breaking selection and dictionary lookup.
First attempt to properly fix this
I tried adding
role="presentation"
to the drama tables. This is the recommended fix for problem 2, and partially resolves 1, but it’s really flaky: some parts of the table no longer produce a viewer mode, but not others. I attempted to addrole="presentation"
additionally to the table rows with no luck.Second proposal
This would be considerably more work, but I think we should evaluate using
display: table
with classed divs instead. To test, I converted The Libation Bearers, replacing<table>
with<div class="drama-table">
,<tr>
with<div class="drama-row">
, and<td>
with<div class="drama-cell">
. I then added appropriatedisplay: table
/display: table-row
/display: table-cell
to local.css.Testing in Apple Books (with the viewer suppression hack removed), this looks fine:
I don’t have a physical Kindle, but I tested loading the same epub into Kindle Previewer, and it looks fine there too:
Work to be done
If we decide to go ahead with this, then the good thing is that it doesn’t need to be a big bang release. The proposed timeline would be:
Question
Worth it?
The text was updated successfully, but these errors were encountered: