rust-lang / rust-lang/mdBook

Ordering of footnote

Open
#2,409 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-footnotes C-enhancement
Dominant language
Rust
Stars
22.2k
Forks
1.9k
PR merge metrics
PR metrics pending

Description

Problem

Currently the footnotes are numbered by their first reference in text, instead of the actual order of the footnote in the end.

For example

aha[^note], that is right[^another_note]

[^another_note]: right
[^note]: aha

Will be rendered to something like

aha^1, that is right^2

2 right
1 aha

Notice the footnote numbered as 2 is placed first.
This is both unnatural and non-customary.

The customary style which is used by most journals is to number the footnotes in the order they are presented at the end.

aha[^note], that is right[^another_note]

[^another_note]: right
[^note]: aha

shall produce

aha^2, that is right^1

1 right
2: aha
Proposed Solution

Number the footnotes by their orders at the end, as most journals do.

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two footnote examples from the issue in mdBook and locate the footnote parsing or rendering entry point; no source file or test is identified in the report. Add a regression test for the requested ordering and verify that footnote references and end notes are numbered consistently with their order at the end.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.