Style tweaks: limit EPUB/FB2 footnotes to these formats

Avoid conflicts having "In-page EPUB footnotes (smaller)"
affects FB2 documents that use "<a type=note>12</a>" which
would then get smaller if both tweaks are enabled (which
they are, by default).
Also switch "-cr-hint: strut-confined" from being set on "*"
to being set only on "body", now that it is inherited.
Footnote popups: add styles for some non-HTML FB2 tags,
so MuPDF can render them as expected.
reviewable/pr6408/r1
poire-z 4 years ago
parent ad8256622d
commit cc653ef5b0

@ -338,8 +338,8 @@ ruby { display: inline !important; }
id = "lineheight_all_normal_strut_confined"; id = "lineheight_all_normal_strut_confined";
title = _("Enforce steady line heights"), title = _("Enforce steady line heights"),
description = _("Prevent inline content like sub- and superscript from changing their paragraph line height."), description = _("Prevent inline content like sub- and superscript from changing their paragraph line height."),
priority = -5, -- so other -cr-hint can override (this one has effect only on inline content) -- strut-confined is among the few cr-hints that are inherited
css = [[* { -cr-hint: strut-confined; }]], css = [[body { -cr-hint: strut-confined; }]],
separator = true, separator = true,
}, },
{ {
@ -650,13 +650,17 @@ This is just an example, that will need to be adapted into a user style tweak.]]
title = _("In-page FB2 footnotes"), title = _("In-page FB2 footnotes"),
description = _([[ description = _([[
Show FB2 footnote text at the bottom of pages that contain links to them.]]), Show FB2 footnote text at the bottom of pages that contain links to them.]]),
-- Restrict this to FB2 documents, even if we won't probably
-- match in any other kind of document
css = [[ css = [[
body[name="notes"] section { body[name="notes"] section {
-cr-hint: footnote-inpage; -cr-only-if: fb2-document;
margin: 0 !important; -cr-hint: footnote-inpage;
margin: 0 !important;
} }
body[name="notes"] > section { body[name="notes"] > section {
font-size: 0.75rem; -cr-only-if: fb2-document;
font-size: 0.75rem;
} }
]], ]],
}, },
@ -667,11 +671,13 @@ body[name="notes"] > section {
Show FB2 endnote text at the bottom of pages that contain links to them.]]), Show FB2 endnote text at the bottom of pages that contain links to them.]]),
css = [[ css = [[
body[name="comments"] section { body[name="comments"] section {
-cr-hint: footnote-inpage; -cr-only-if: fb2-document;
margin: 0 !important; -cr-hint: footnote-inpage;
margin: 0 !important;
} }
body[name="comments"] > section { body[name="comments"] > section {
font-size: 0.85rem; -cr-only-if: fb2-document;
font-size: 0.85rem;
} }
]], ]],
separator = true, separator = true,
@ -685,7 +691,8 @@ FB2 footnotes and endnotes get a smaller font size when displayed in-page. This
body[name="notes"] > section, body[name="notes"] > section,
body[name="comments"] > section body[name="comments"] > section
{ {
font-size: 1rem !important; -cr-only-if: fb2-document;
font-size: 1rem !important;
} }
]], ]],
}, },
@ -697,6 +704,7 @@ body[name="comments"] > section
description = _([[ description = _([[
Show EPUB footnote text at the bottom of pages that contain links to them. Show EPUB footnote text at the bottom of pages that contain links to them.
This only works with footnotes that have specific attributes set by the publisher.]]), This only works with footnotes that have specific attributes set by the publisher.]]),
-- Restrict this to EPUB documents, as FB2 can have <a type="note">
css = [[ css = [[
*[type~="note"], *[type~="note"],
*[type~="footnote"], *[type~="footnote"],
@ -705,8 +713,9 @@ This only works with footnotes that have specific attributes set by the publishe
*[role~="doc-footnote"], *[role~="doc-footnote"],
*[role~="doc-rearnote"] *[role~="doc-rearnote"]
{ {
-cr-hint: footnote-inpage; -cr-only-if: epub-document;
margin: 0 !important; -cr-hint: footnote-inpage;
margin: 0 !important;
} }
]], ]],
}, },
@ -716,6 +725,8 @@ This only works with footnotes that have specific attributes set by the publishe
description = _([[ description = _([[
Show EPUB footnote text at the bottom of pages that contain links to them. Show EPUB footnote text at the bottom of pages that contain links to them.
This only works with footnotes that have specific attributes set by the publisher.]]), This only works with footnotes that have specific attributes set by the publisher.]]),
-- Restrict this to EPUB documents, as FB2 can have <a type="note">
-- and we don't want to have them smaller
css = [[ css = [[
*[type~="note"], *[type~="note"],
*[type~="footnote"], *[type~="footnote"],
@ -724,9 +735,10 @@ This only works with footnotes that have specific attributes set by the publishe
*[role~="doc-footnote"], *[role~="doc-footnote"],
*[role~="doc-rearnote"] *[role~="doc-rearnote"]
{ {
-cr-hint: footnote-inpage; -cr-only-if: epub-document;
margin: 0 !important; -cr-hint: footnote-inpage;
font-size: 0.8rem !important; margin: 0 !important;
font-size: 0.8rem !important;
} }
]], ]],
separator = true, separator = true,

@ -90,6 +90,11 @@ body > li { list-style-type: none; }
/* Remove any (possibly multiple) backlinks in Wikipedia EPUBs footnotes */ /* Remove any (possibly multiple) backlinks in Wikipedia EPUBs footnotes */
.noprint { display: none; } .noprint { display: none; }
/* Style some FB2 tags not known to MuPDF */
emphasis { font-style: italic; }
strikethrough { text-decoration: line-through; }
underline { text-decoration: underline; }
/* Attempt to display FB2 footnotes as expected (as crengine does, putting /* Attempt to display FB2 footnotes as expected (as crengine does, putting
* the footnote number on the same line as the first paragraph via its * the footnote number on the same line as the first paragraph via its
* support of "display: run-in" and a possibly added autoBoxing element) */ * support of "display: run-in" and a possibly added autoBoxing element) */

Loading…
Cancel
Save