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

Allow linking to specific impls in rustdoc #23552

Closed
huonw opened this issue Mar 20, 2015 · 4 comments
Closed

Allow linking to specific impls in rustdoc #23552

huonw opened this issue Mar 20, 2015 · 4 comments
Assignees
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@huonw
Copy link
Member

huonw commented Mar 20, 2015

It is useful if one is explaining where a method/functionality comes from to be able to link the specific impl ... for X on the page for X. E.g. I'm just now writing something about string slicing, so it would be nice to be able to point to the impl Index<Range<usize>> for str part of http://doc.rust-lang.org/nightly/std/primitive.str.html .

@huonw huonw added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 20, 2015
@huonw huonw changed the title Allow linking to specific impls rustdoc Allow linking to specific impls in rustdoc Mar 20, 2015
@steveklabnik
Copy link
Member

Triage: no change here

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@mcarton
Copy link
Member

mcarton commented Jun 28, 2017

👍 This would be quite useful, I just wanted to point out to a friend why String + &str is possible, but there is no way to point to this particular implementation. This is especially annoying since this implementation is rather well documented.

@Mark-Simulacrum Mark-Simulacrum added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Jul 22, 2017
@QuietMisdreavus QuietMisdreavus added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Aug 15, 2017
@QuietMisdreavus QuietMisdreavus self-assigned this Aug 15, 2017
@QuietMisdreavus
Copy link
Member

This should be a fairly small change, so i'm opening it up to new contributors. in src/librustdoc/html/render.rs, there's a function called render_impl that has some code at the top that prints the impl line. The change to fix this would be to add a spot in between where it prints i.inner_impl() and the next print to add an anchor link that points to the h3 right there. There's a function available called derive_id that you can hand a potential id to that will make sure you get a unique anchor for your link. Actually inserting the anchor can be done like in #43747 so you get a nice section marker that pops up on hover.

If you'd like to work on this and want help, let me know! I'm "misdreavus" on IRC. I'd love to get you acclimated to working on rustdoc.

Jouan added a commit to Jouan/rust that referenced this issue Aug 18, 2017
Implements a solution for issue rust-lang#23552
frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 26, 2017
…umeGomez

Add links for impls

Implements a solution for issue rust-lang#23552
r? @QuietMisdreavus
@QuietMisdreavus
Copy link
Member

Since #43979 got merged, i'll close out this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants