Repository navigation
style tweak: Extend inpage footnotes - #13554
Conversation
| -cr-only-if: following-inpage-footnote -inpage-footnote; | ||
| -cr-hint: extend-footnote-inpage; | ||
| margin: 0 !important; |
There was a problem hiding this comment.
More indentation on the lines following a -cr-only-if: (to make it visually clear the next apply only-if :) ala python.
cf the existing ones.
|
Fine with the first - it's generic enough. Not fine with the second, it brings too much of the existing noisy classname ones. If you feel they need to be mentionned somewhere so users know they exist, we can also mention them in the koreader/frontend/apps/reader/modules/readerstyletweak.lua Lines 884 to 889 in 09772fd |
d9abc15 to
c73f0e4
Compare
|
If you add 2 items, we'll get 11 items, with one on the 2nd page (in landscape mode). |
|
I'm fine with a submenu if you're willing to have multiple versions of this tweak. (and maybe someone comes up with another one in the future) I do think having the two versions "until next footnote" (aka Having a version with |
I think the fix for (2) is somewhat dependent on order / selector specificity but seems to work at least in my testing. I think the only possible alternative (that doesn't need a new crengine feature) is adding "smaller" variants for each footnote extension and the user having to make sure they match if they want consistent styling. |
|
Marked as non-draft on the basis that I think koreader/crengine#618 is pretty much ready. |
|
@Commodore64user replying to you here instead of #13613 (comment) to keep the discussion more focused.
@poire-z and myself discussed that here. The reason I put them outside fix-ups is that fix-ups are all about how footnotes are styled, whereas the top level settings (and the new extension stuff) are about which lines are selected to be footnotes. And there might be more common cases like "until the next heading" that could go in the same menu (not sure which, would need more people to use it and report back).
I tried that just now but I think it's too long. Everywhere I was able to test it's cut of and ellipsized. |
|
Mmm… |
|
Well, my head didn't read those as a choice so it was a bit long. (and maybe I made a copy&paste mistake) 😅 Maybe the "until the next footnote" part should just be in the description, so it can be
Every entry in this submenu would be |
|
better to have the first as |
| -cr-only-if: -fb2-document; | ||
| -cr-hint: footnote-inpage; | ||
| margin: 0 !important; | ||
| } | ||
| *, autoBoxing { | ||
| -cr-hint: late; | ||
| -cr-only-if: inpage-footnote; | ||
| font-size: 0.8rem !important; | ||
| } | ||
| *, autoBoxing { | ||
| -cr-hint: late; | ||
| -cr-only-if: extended-inpage-footnote; |
There was a problem hiding this comment.
Can't the first *, autoBoxing { content still be held in the *[role~="doc-rearnote"] {, to avoid a CSS check ?
There was a problem hiding this comment.
Sure. I think I was splitting it out because I was already thinking about #13613 and it needs to be separate there.
There was a problem hiding this comment.
Reduced this to one extra CSS check with koreader/crengine#620
| title = _("Extend footnote content until next entry"), | ||
| description = _([[ | ||
| Extend in-page footnotes shown at the bottom of pages to include text up to the next footnote. | ||
| This is needed when books don't correctly mark all text that belongs to the footnote.]]), |
There was a problem hiding this comment.
may be / might be (because who are we to force inpage footnotes to the use ? :)) I think that's the tone we have in other tweak descriptions.
| { | ||
| title = _("In-page footnote extension"), | ||
| { | ||
| id = "following-footnote-inpage_all", |
There was a problem hiding this comment.
(Dunno if _all is standardized elsewhere, but _any -or nothing- feels more accurate?)
There was a problem hiding this comment.
changed to _any (and adjusted the id prefix to extend-footnote-inpage_following-inpage-footnote_ which I think fits with the existing naming scheme based on the -cr-hint / -cr-only-if that is applied or used).
There was a problem hiding this comment.
Feels a bit long though :) (related to all the other ids).
extend-footnote-inpage_following-inpage-footnote_
May be just ("following inpage footnote" seems implied with "extend footnote inpage"):
extend-footnote-inpage_any
extend-footnote-inpage_until_next_heading
?
(Not enough energy to review the rest this evening.)
There was a problem hiding this comment.
Looks ok, but still waiting for these to get shorter :)
There was a problem hiding this comment.
sorry, had forgotten about this. They are shorter now 👍
| *, autoBoxing { | ||
| -cr-only-if: following-inpage-footnote -inpage-footnote; | ||
| -cr-hint: extend-footnote-inpage; |
There was a problem hiding this comment.
It feels that this, having a really low specificity, may not match those that get to be inpage-footnotes with *[type~="note"] or .footnote which has a higher specificity.
Is -cr-hint: late the solution ? Dunno how everything behave when multiple cr-hint late setting other hints... moreover when one would use -cr-only-if: extended-inpage-footnote...
There was a problem hiding this comment.
It's certainly more fragile, I'll do some testing with -cr-hint: late.
-cr-only-if: extended-inpage-footnote is essentially only needed to set the smaller font-size above for well behaved books where you don't need to force a single size via the -cr-only-if: inside-inpage-footnote hint.
We could also go back and make -cr-only-if: inpage-footnote also match extended footnotes. Less css but also less flexible. I at least found it useful in debugging to match the extended blocks specifically.
There was a problem hiding this comment.
Logically, -cr-only-if: inpage-footnote (named inpage-foonote, different from the hint name footnote-inpage) should match what has ended up being a footnote, not what had the hint.
So yes, I think it should also match extended footnotes.
Same for inside-inpage-footnote, which should match stuff inside an extended footnote block.
(I'm out for the day.)
There was a problem hiding this comment.
I agree, changed it here and dropped the unneeded -cr-only-if: extended-inpage-footnote: koreader/crengine#620
There was a problem hiding this comment.
I remembered why I didn't originally add late: I had problems with specificity like you hinted at.
I did what I think is the correct fix now by using -cr-hint: late to ensure it's applied after footnotes are marked as well as :where() and priority to ensure it's lower specificity than other late hints that style footnotes. (I only learned today that tweak order depends on the name of the tweak, so priority is actually necessary).
`-cr-hint: late` should ensure extending is applied after base footnote hints. `:where` and `priority` ensure it's applied before anything that modifies footnote styling.
|
Will need a crengine into base bump, and a base into frontend bump. |
|
I think you need to bump base in this PR (if it should be merged before the other one). |
Brings in koreader/crengine#618 & koreader/crengine#620 for koreader#13554 Repo: base
Brings in koreader/crengine#618 & koreader/crengine#620 for koreader#13554 Repo: base

Style tweak for koreader/crengine#618 to allow extending footnotes across lines from consecutive nodes.
Suggestions welcome where it should live. I'd argue it belongs top-level as it selects what gets shown as footnotes, just like the other tweaks there.
Depends on:
-cr-only-if: inpage-footnotematches extended footnotes crengine#620This change is