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: add [src] links to provided methods on a trait's page #45150

Closed
QuietMisdreavus opened this issue Oct 9, 2017 · 6 comments · Fixed by #79181
Closed

rustdoc: add [src] links to provided methods on a trait's page #45150

QuietMisdreavus opened this issue Oct 9, 2017 · 6 comments · Fixed by #79181
Assignees
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. 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

@QuietMisdreavus
Copy link
Member

QuietMisdreavus commented Oct 9, 2017

For example, here's a method on Iterator right now:

image

Since this is a provided method, there's a worthwhile implementation to link to, so it would be nice to be able to link to it's implementation, by adding a [src] link to the method header here.

@QuietMisdreavus QuietMisdreavus added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Oct 9, 2017
@QuietMisdreavus
Copy link
Member Author

(Note: I created this issue just so i could mentor someone on it, so consider it claimed!)

@timotree3
Copy link
Contributor

@QuietMisdreavus I want to take this on. I'm gonna start looking for the relevant parts of the code.

@timotree3
Copy link
Contributor

I think the fix belongs somewhere in fn doc_impl_item, but I don't fully understand the function yet.

@timotree3
Copy link
Contributor

My bad, I guess you mean that there is a specific person you're mentoring on it. Not that you want to mentor whoever takes it on.

@jyn514 jyn514 changed the title rustdoc: add [src] links to items on a trait's page rustdoc: add [src] links to provided methods on a trait's page Nov 5, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 5, 2020

Since it's been a few years, I think we can safely assume this issue is unclaimed.

@aDotInTheVoid
Copy link
Member

@rustbot claim

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Nov 19, 2020
…e-link, r=jyn514,GuillaumeGomez

rustdoc: add [src] links to methods on a trait's page

Closes rust-lang#45150

![image](https://user-images.githubusercontent.com/28781354/99565541-aba4d500-29c3-11eb-99c7-11c1f91584e9.png)

### Caveats

- The way I've implemented it, links are also provided for required methods, that just link to the signature in the code. I'm not sure if this is the desired behaviour.

![image](https://user-images.githubusercontent.com/28781354/99566222-849ad300-29c4-11eb-9897-08cc5842954f.png)

- I'm not sure if the css changes are correct. I inspected them visualy on firefox on desktop, and they seem to be fine.
- I can't tell how `src/librustdoc/html/render/mod.rs` is structured, so I probably
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Nov 19, 2020
…e-link, r=jyn514,GuillaumeGomez

rustdoc: add [src] links to methods on a trait's page

Closes rust-lang#45150

![image](https://user-images.githubusercontent.com/28781354/99565541-aba4d500-29c3-11eb-99c7-11c1f91584e9.png)

### Caveats

- The way I've implemented it, links are also provided for required methods, that just link to the signature in the code. I'm not sure if this is the desired behaviour.

![image](https://user-images.githubusercontent.com/28781354/99566222-849ad300-29c4-11eb-9897-08cc5842954f.png)

- I'm not sure if the css changes are correct. I inspected them visualy on firefox on desktop, and they seem to be fine.
- I can't tell how `src/librustdoc/html/render/mod.rs` is structured, so I probably
@bors bors closed this as completed in 192ed76 Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. 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

Successfully merging a pull request may close this issue.

4 participants