Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML writer: Use different structure for epub footnotes. #8676

Merged
merged 3 commits into from
Mar 8, 2023
Merged

Conversation

jgm
Copy link
Owner

@jgm jgm commented Mar 8, 2023

Many EPUB readers are thrown off by pandoc's current footnote output. Both the ol and the fact that the footnote backlink is at the end of the note seem to pose problems.

With this commit, we now create a list of aside (or div) elements, instead of an ordered list. Each element begins with a note number that is linked back to the note reference. (So, the backlink occurs at the beginning rather than the end.)

References:

Obsoletes #8672, closes #5583.

Thanks to @Porges and @lewer.

Many EPUB readers are thrown off by pandoc's current footnote
output.  Both the ol and the fact that the footnote backlink is
at the end of the note seem to pose problems.

With this commit, we now create a list of aside (or div) elements,
instead of an ordered list. Each element begins with a note number
that is linked back to the note reference.  (So, the backlink occurs
at the beginning rather than the end.)

References:

- https://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf
- http:https://kb.daisy.org/publishing/docs/html/notes.html

See #8672, closes #5583.

Thanks to @Porges and @lewer.
@jgm
Copy link
Owner Author

jgm commented Mar 8, 2023

One note: I tried this on macos Books and got a duplicated note number:

Screen Shot 2023-03-07 at 9 49 02 PM

The big note number is apparently being added by Books app. Let me know what you see on Kindle and other readers.

@lewer
Copy link
Contributor

lewer commented Mar 8, 2023

Thanks a lot for this @jgm.

Here's what I have with Kindle (tested with Kindle previewer) and Google Play Books.

The result is great, footnotes appear individually in the popup. Kindle and Google Play Books are able to retrieve the note's number and a title is added to the popup: Footnote number ...
I guess this is what Books also does, but with no "Footnote" prefix, only the number.

Just to let you know: in the epub source, there's an empty line between the <hr /> that opens the footnote section and the first <aside>, and also an empty line between the last <aside> and the closing </section> tag.

@jgm
Copy link
Owner Author

jgm commented Mar 8, 2023

I've pushed a fix for the newlines.

@jgm jgm merged commit 92b3179 into main Mar 8, 2023
@jgm jgm deleted the epub-footnotes branch March 8, 2023 17:24
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.

Adjust EPUB footnotes with backlink before text.
2 participants