Quote:
Originally Posted by roger64
@nqk
Thanks for your quite interesting EPUB. I observe also that solutions 2 and 3 work fine for the Calibre viewer (only one note displayed).
However, with Epubcheck, this EPUB triggers 16 errors, mainly because it's an EPUB2 with "incorrect" EPUB3 tags and attributes (noteref, aside, epub-type, etc.).
As such I am afraid that this solution can't be "officially" recommended for EPUB2 books which form the majority of our libraries.
What is curious is that the Calibre Editor does not support EPUB3 while some EPUB3 features like this one seems to fit the Viewer the best.
The idea to insert the id in the p tag does not seem good either because sometimes the a tag can be quite far away from the opening paragraph tag. Maybe putting the id in an attached or encapsulated "dummy" span (I mean just created for this purpose) would do it.
I really would feel better if we had some advice coming from Kovid Goyal on this endnote display topic.
|
I've just been playing and looking at the code. The short answer is: put the id on the p tag. Or div or whatever you are using.
Basically what is happening is that a footnote is everything from the tag containing the destination id, to the next tag that has an id. So, it the ids are in successive p tags, then only that paragraph will be shown as the footnote.
There's a complication if the id is in a contained tag. For the start of the footnote, the parents of the tag with the id in it are shown. For the end of footnote, the parent tag is shown, but none of the child tags are shown.
As an example of this, taken from nqk's sample, with the following in the footnotes:
Code:
<p class="note"><a href="1.xhtml#nl1" id="n1">[1]</a> Note 1.</p>
<p class="note"> <b>Note 2.<a href="1.xhtml#nl2" id="n2">[2]</a>Note 2a.</b>Note 2b. <b>Note 2c.</b></p>
<p class="note"><a href="1.xhtml#nl3" id="n3">[3]</a> Note 3.</p>
And the footnote references are:
Code:
<p>The quick brown fox jumps over the lazy dog.<a href="1_split1.xhtml#n1" id="nl1" epub:type="noteref"><sup>(1)</sup></a></p>
<p>The quick brown fox jumps over the lazy dog.<a href="1_split1.xhtml#n2" id="nl2" epub:type="noteref"><sup>(2)</sup></a></p>
Clicking the first link shows:
Code:
[1] Note 1.
Note 2.Note 2a.Note 2b.
In this, the anchor is not displayed, the text in the parent p is, but no other children of the p are shown.
Clicking the second link, shows:
Code:
Note 2.[2]Note 2a.Note 2b. Note 2c.
Note 3.