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

Add the item type to the tooltip #39697

Merged
merged 2 commits into from
Feb 12, 2017
Merged

Conversation

notriddle
Copy link
Contributor

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@QuietMisdreavus
Copy link
Member

Nice! Would it be possible to render the docs with this and get a couple screenshots with the new tooltips?

@notriddle
Copy link
Contributor Author

tooltip1
tooltip2
tooltip3
tooltip4

@notriddle
Copy link
Contributor Author

And, one last thing, the Result types:

tooltip5
tooltip6

@QuietMisdreavus
Copy link
Member

Thanks! That one with Iterator::Item is a little weird. It's pulling from the same type info that its link is getting, so in that sense it's correct, but something seems off if everything else has the same name as its text but that. I'd like for that to have something like type std::iter::Iterator::Item but I'm not sure how you'd get there offhand. (That might also cause associated items to render in orange, since that's the color for "type"s.)

@GuillaumeGomez
Copy link
Member

Thanks a lot for this. Since everyone seems to agree on the improvement here, let's merge!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Feb 12, 2017

📌 Commit bc4ad1a has been approved by GuillaumeGomez

bors added a commit that referenced this pull request Feb 12, 2017
Rollup of 7 pull requests

- Successful merges: #39654, #39662, #39697, #39740, #39743, #39756, #39760
- Failed merges:
@bors bors merged commit bc4ad1a into rust-lang:master Feb 12, 2017
@notriddle notriddle deleted the rustdoc_tooltip branch February 12, 2017 21:12
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 14, 2023
…-tooltips, r=GuillaumeGomez

rustdoc: add more tooltips to intra-doc links

This commit makes intra-doc link tooltips consistent with generated links in function signatures and item tables, with the format `itemtype foo::bar::baz`. This way, you can tell if a link points at a trait or a type (for example) by mousing over it.

See also rust-lang#39697

Partially solves https://internals.rust-lang.org/t/rustdoc-suggestion-highlight-links-fn-s-mod-s-type-s-etc-appropriately-within-and-documentation/17931 (though the Internals thread asks for color-coding, while this PR adds a tooltip instead, it's accomplishing the same thing).

Before:

<img width="950" alt="image" src="https://user-images.githubusercontent.com/1593513/218653059-911cea01-7231-438a-ad98-be98ab73783f.png">

After:

<img width="432" alt="image" src="https://user-images.githubusercontent.com/1593513/218653201-34ca3aa7-18f1-4cb1-be68-a1411bbe797e.png">
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