-
Notifications
You must be signed in to change notification settings - Fork 47
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
Footnote pop-up and backreference links #123
Footnote pop-up and backreference links #123
Conversation
Seems like there is new compiler version issue. |
@blandger It passes the checks now 👍 |
This PR deserves to have footnotes in markdown page of integration tests for users to know how to use. Maybe we can add another dummy to build ePub3 book and to verify it? |
self.hbs.render("index", &ctx) | ||
} | ||
|
||
fn render_with_footnote_backrefs(&self, chapter_dir: &Path, ch: &Chapter) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe extracting closures at L304 & L385 to functions would improve readability. And extracting link filter logic to a function may reduce repetition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to extract the one that was at L304 with the compiler messages helping me through it, but the other one gave me errors that I don't know how to deal with.
I added a dummy with |
Agree. I even think about several 'dummy book' examples/instances with different checking aspects. Like one book is for checking links between pages, another for local images check, third is for remote images check. |
Fixes were merged. Several libs are updated. Pls upgrade your branch by master. |
Seems ok now 👍 |
Overall I like that feature in the epub book, it looks very convenient and works fine (on my onyx ebook). Popup footnotes is what I really miss inside PDF books. |
This adds an option to add backreference links at the end of footnote definitions, so that the user can return and continue reading the main body of the text.
The code is based on the footnote-rewrite.rs example.
The pop-up footnote behaviour requires the use of
<aside>
tag and so EPUB 3 is required.I think most users would expect this behaviour and so I set the
footnote-backrefs
option totrue
by default, but it is only used whenepub-version = 3
is already selected.On a Kindle Paperwhite, the footnote definition appears in a pop-up bottom window when the footnote reference number is tapped.
In KOReader on Remarkable 2 the footnote definition appears at the bottom of the screen.
The footnote definitions include a backreference link to jump back to the main body of the text.
This feature was also discussed at #65