Skip to content

css_tweaks: Reimplement smaller inpage footnotes #13639

Closed
moben wants to merge 2 commits into
koreader:masterfrom
moben:footnotes_dynamic_size_tweak
Closed

css_tweaks: Reimplement smaller inpage footnotes #13639
moben wants to merge 2 commits into
koreader:masterfrom
moben:footnotes_dynamic_size_tweak

Conversation

@moben

@moben moben commented Apr 20, 2025

Copy link
Copy Markdown
Contributor

Alternative to #13613 that

  • completely gets rid of the "smaller" footnote setting
  • has a single set of size selection tweaks
  • Should keep current default behavior as well as current font-size override behavior

This is done by introducing dynamic footnote tweaks that can change based on which other tweaks are set.

In short:

  • Footnote size tweaks by default behave like "smaller" footnotes behave now (except not hard-coded to 80%)
  • Footnote size tweaks keep the FB2 footnotes 0.75rem / 0.85rem distinction for footnotes vs endnotes
  • A new "Override publisher footnote size" tweak enables the hard size override that the footnote size tweaks do on master

The dynamic style hint displays the current css in the popup, but there's no way to see other possible instantiations, which is a bit of a downside. I'm honestly not completely sure if it's worth the complexity compared to just keeping the "smaller" footnotes (maybe with #13613 as a small cleanup)

@poire-z I think this might address your concerns from #5863 (comment) / #5863 (comment), though obviously at the cost of complexity.

Note: I don't know if I got the fb2 hints right, might need someone to check or point me at a free fb2 book with footnotes & endnotes to test with.


This change is Reviewable

@Frenzie

Frenzie commented Apr 20, 2025

Copy link
Copy Markdown
Member

though obviously at the cost of complexity.

I don't really like the code side of things for that reason, but would you happen to have one or two screenshots of what the menu looks like?

@poire-z

poire-z commented Apr 20, 2025

Copy link
Copy Markdown
Contributor

Sorry, still a bit too busy to dig in (and see how I like it or not).

Note: I don't know if I got the fb2 hints right, might need someone to check or point me at a free fb2 book with footnotes & endnotes to test with.

Here's one (shared a long time ago around here): Proffer_Klyuchi-k-Lolite-.EeRvzA.159923.zip

About the difference in font size for footnotes vs endnotes (notes vs. comments), let's ask @hius07 @mergen3107 how much this is needed and nice.

@moben

moben commented Apr 20, 2025

Copy link
Copy Markdown
Contributor Author

Screenshots:

As I said, #13613 might be better. But @poire-z's comments made me curious if there's a good way to do this.

The other option would be to duplicate all the footnote size tweaks to have a variant that forces the size for all block children and one that just sets it on the root element. A lot more tweaks but it's in a submenu. That also allows dropping the "smaller" versions from the top level menu.

Comment on lines +896 to +897
if global_tweaks["font-size_" .. pct] then
global_tweaks["inpage_footnote_text_force_size"] = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original footnote font size tweaks are named id = T("inpage_footnote_font-size_%1", pct), so you're missing inpage_footnote_ on line 896 ?

Comment on lines +959 to +960
local fb2_notes_rem = 0.75 * rem / 0.8
local fb2_comments_rem = 0.85 * rem / 0.8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If going with that, you'll probably want to format these to 2 digits after the dot.

@poire-z

poire-z commented Apr 25, 2025

Copy link
Copy Markdown
Contributor

(Haven't read yet your other alternative PR.)

I would have no real problem with the dynamic building.

What I don't really like is having the footnote text long and including all the specific FB2 stuff.
I like each tweaks to have some effect, but also to be small and serve as tutorial and be copy'and'pastable. These long ones are targetted to have the effect written on the tin, but it's a lot of technical twisted stuff to achieve it, which is not reusable.
So, dunno yet if I like it better than the other :)

@moben

moben commented May 1, 2025

Copy link
Copy Markdown
Contributor Author

I think you convinced me that #13613 is better, so I'm closing this. It's very hard to keep these dynamic ones small enough to also serve as docs/tutorial.

@moben moben closed this May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants