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
build: Fix Kobo poetry build compatibility #511
Conversation
That's great! Are you able to test on an actual Kobo to make sure the ebook works correctly? IIRC the spans are there to enable user highlighting/notetaking/dictionary lookups, so if those work on a Kobo with this new process then that's good. Did you test any other ebooks in the corpus? What I would suggest is using the Some ebooks to try this on would be Keats, Frost, Carroll. |
This has a demonstration of the rendering on a Kobo. I didn't know about |
Is that eink? Does highlighting/dictionary work? |
Yes, it is eink and the highlighting and dictionary work as I demonstrate on the last few pages. (I used a scanning app on my phone to take the pictures, which applied a black and white filter to some of the images.) |
Great, thanks. Let me know if compare-versions comes up clean. |
Ok, so I'm doing the
I gave up on Carroll because that repo is huge and slow to build, and there isn't that much poetry in there anyways. All of the endnote differences are expected (it's just the different backlink character used for Kobo). The reason I tested against the compatible epub build was that I did notice an unrelated existing issue with footers and CSS specificity with the compatibility epub while building de Cleyre. I'm going to file a separate issue for that. |
OK, fantastic work Weijia. Thanks! |
I spent today working on this and I think I have a satisfying fix for the Kobo poetry build issue. The code boils down to this:
kobo-verse-span
. Thexpath
uses the predicate[not(text()[normalize-space() != ''])]
to distinguishp
s that represent stanzas from prosep
s . The idea behind this is that a stanzap
should not have any text nodes as its children since all of the text will be in thespan
s.span
s inside verses target spans with the classkobo-verse-span
.Here's an example of a de Cleyre poem with a broken header and footer before the fix:
This is the same poem with the fix:
Here is an example of a broken Newman epigraph:
This is the fixed epigraph:
This also plays well when you have a verse epigraph for a poem.
Here is an example showing how we aren't adding the
kobo-verse-span
class to a non-versespan
(the Roman numeral at the end):vs.
I'm happy to check out more edge cases but I feel pretty confident in this.