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 individual impls #33382

Merged
merged 1 commit into from
May 7, 2016

Conversation

birkenfeld
Copy link
Contributor

@birkenfeld birkenfeld commented May 3, 2016

Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.

NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.

Fixes: #30416

@rust-highfive
Copy link
Collaborator

r? @steveklabnik

(rust_highfive has picked a reviewer for you, use r? to override)

@birkenfeld
Copy link
Contributor Author

Screenshots:
shot1
shot2

@GuillaumeGomez
Copy link
Member

I'll take a look to the CSS.

@steveklabnik
Copy link
Member

I like it! Thanks!

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented May 5, 2016

📌 Commit 7a0d317 has been approved by steveklabnik

@steveklabnik
Copy link
Member

@bors: r-

actually, i would like @alexcrichton to also check this out; it's a relatively big diff to the internals and he knows them better than I

impl_: i,
dox: attrs.value("doc").map(|s|s.to_owned()),
stability: item.stability.clone(),
// FIXME: would like to move the item here, but
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the bindings above were switched to ref? Wouldn't that mean you can avoid the clone() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the ref above, I can't even access item anymore since it's been partially moved; with the ref, I can't move it into the Impl because it's partially borrowed :)

@alexcrichton
Copy link
Member

Thanks! We've also had requests to jump to the source of a particular method itself from time to time, but only having it on impls for now seems like a nice balance between clutter and usability, so sounds like a good strategy to me.

Since these impls can be scattered around quite a bit, it is nice
to be able to jump to the location where individual methods and
trait impls are defined.

Fixes: rust-lang#30416
@birkenfeld
Copy link
Contributor Author

Pushed a new version with review comments addressed.

@alexcrichton
Copy link
Member

@bors: r+ 89aa042

Thanks!

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 7, 2016
rustdoc: add "src" links to individual impls

Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.

NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.

Fixes: rust-lang#30416
steveklabnik added a commit to steveklabnik/rust that referenced this pull request May 7, 2016
rustdoc: add "src" links to individual impls

Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.

NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.

Fixes: rust-lang#30416
steveklabnik added a commit to steveklabnik/rust that referenced this pull request May 7, 2016
rustdoc: add "src" links to individual impls

Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.

NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.

Fixes: rust-lang#30416
bors added a commit that referenced this pull request May 7, 2016
@bors bors merged commit 89aa042 into rust-lang:master May 7, 2016
@birkenfeld birkenfeld deleted the issue-30416 branch May 7, 2016 23:48
Manishearth added a commit to Manishearth/rust that referenced this pull request May 9, 2016
Manishearth added a commit to Manishearth/rust that referenced this pull request May 9, 2016
Manishearth added a commit to Manishearth/rust that referenced this pull request May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants