Skip to content

Conversation

@gambhiro
Copy link
Contributor

@gambhiro gambhiro commented Nov 7, 2024

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.

It can be enabled with a TOML option:

[output.html]
footnote-backrefs = true

This feature has been requested before in #1927

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Nov 7, 2024
ehuss added a commit to ehuss/mdBook that referenced this pull request Mar 30, 2025
This makes several changes to how footnotes are rendered:

- Backlinks are now included, which links back to the reference so you
  can continue reading where you left off.
- Footnotes are moved to the bottom of the page. This helps with the
  implementation of numbering, and is a style some have requested. I
  waffled a lot on this change, but supporting the in-place style was
  just adding too much complexity.
- Footnotes are now highlighted when you click on a reference.
- Some of the spacing for elements within a footnote has now been fixed
  (such as supporting multiple paragraphs).
- Footnote navigation now scrolls to the middle of the page.

This is an alternative to rust-lang#2475

Closes rust-lang#1927
Closes rust-lang#2169
Closes rust-lang#2595
@ehuss
Copy link
Contributor

ehuss commented Mar 30, 2025

Thanks for the PR! I went ahead and pushed #2626. I didn't feel like I wanted to make this configurable, and there were a number of changes and fixes I wanted to include. I appreciate your help moving this forward, it is something I've wanted for some time.

@ehuss ehuss closed this Mar 30, 2025
rik86189 pushed a commit to rik86189/mdBook that referenced this pull request Apr 3, 2025
This makes several changes to how footnotes are rendered:

- Backlinks are now included, which links back to the reference so you
  can continue reading where you left off.
- Footnotes are moved to the bottom of the page. This helps with the
  implementation of numbering, and is a style some have requested. I
  waffled a lot on this change, but supporting the in-place style was
  just adding too much complexity.
- Footnotes are now highlighted when you click on a reference.
- Some of the spacing for elements within a footnote has now been fixed
  (such as supporting multiple paragraphs).
- Footnote navigation now scrolls to the middle of the page.

This is an alternative to rust-lang#2475

Closes rust-lang#1927
Closes rust-lang#2169
Closes rust-lang#2595
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants