FB2 footnotes: handle them just as other footnotes

- FB2 footnotes are no more rendered in-page by default
- In-page rendering can be enable by the added Style tweak
- FB2 footnotes can also show in footnote popup (with
  some added not-so-nice CSS so MuPDF can render them
  as crengine)
reviewable/pr5906/r1
poire-z 4 years ago
parent 2cbce841c5
commit a5232594d9

@ -1000,13 +1000,15 @@ function ReaderLink:showAsFootnotePopup(link, neglect_current_location)
-- if not trusted, checks marked (*) don't apply
flags = flags + 0x0002
end
-- Checks for private CSS properties "-cr-hint: footnote/noteref/..." are
-- always done (they can be applied to specific elements or classe names
-- with Styles tweaks.)
-- Trust role= and epub:type= attribute values if defined, for source(*) and target
-- (If needed, we could add a check for a private CSS property "-cr-hint: footnote"
-- or "-cr-hint: noteref", so one can define it to specific classes with Styles
-- tweaks.)
flags = flags + 0x0004
-- flags = flags + 0x0008 -- Unused yet
-- Accept classic FB2 footnotes: body[name="notes" or "comments"] > section
flags = flags + 0x0008
-- TARGET STATUS AND SOURCE RELATION
-- Target must have an anchor #id (ie: must not be a simple link to a html file)

@ -613,6 +613,22 @@ This is just an example, that will need to be adapted into a user style tweak.]]
},
{
title = _("In-page footnotes"),
{
id = "footnote-inpage_fb2";
title = _("In-page FB2 footnotes"),
description = _([[
Show FB2 footnote text at the bottom of pages that contain links to them.]]),
-- (fb2.css already set font-size to 70% - so no need for a "smaller" variant)
css = [[
body[name="notes"] section,
body[name="comments"] section
{
-cr-hint: footnote-inpage;
margin: 0 !important;
}
]],
separator = true,
},
{
id = "footnote-inpage_epub";
title = _("In-page EPUB footnotes"),

@ -89,6 +89,21 @@ body > li { list-style-type: none; }
/* Remove any (possibly multiple) backlinks in Wikipedia EPUBs footnotes */
.noprint { display: none; }
/* Attempt to display FB2 footnotes as expected (as crengine does, putting
* the footnote number on the same line as the first paragraph via its
* support of "display: run-in" and a possibly added autoBoxing element) */
body > section > autoBoxing > *,
body > section > autoBoxing > title > *,
body > section > title,
body > section > title > p,
body > section > p {
display: inline;
}
body > section > autoBoxing + p,
body > section > p + p {
display: block;
}
]]
-- Add this if needed for debugging:

Loading…
Cancel
Save