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

rustdoc: Footnotes don't work well when used on multiple doc comments that share page. #131901

Open
aDotInTheVoid opened this issue Oct 18, 2024 · 0 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@aDotInTheVoid
Copy link
Member

pub struct Foo;

impl Foo {
    /// Link 1 [^1]
    ///
    /// [^1]: Hiya
    pub fn l1(){}

    /// Link 2 [^2]
    ///
    /// [^2]: Biya
    pub fn l2() {}
}

Image

Not only is this ugly, but both footnotes use the same link/number, despite being seperate in the source code.

I think the right thing to do here is to show all footnotes for a page in one place (at the bottom). This may have some subtle interactions with when markdown content appears on multiple pages (eg summaries, trait methods), but I've not looked into the details yet.

Origionly inspired by this output:

Image

@aDotInTheVoid aDotInTheVoid added A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Oct 18, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 18, 2024
@aDotInTheVoid aDotInTheVoid removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

No branches or pull requests

3 participants
@aDotInTheVoid @rustbot and others