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 a button to copy the "use statement" #83721

Merged
merged 1 commit into from
Apr 2, 2021

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Mar 31, 2021

Fixes #50239

When clicking on the button, it'll add the elements prepended by "use " and will end with a ";". So in the images below, I now have in my clipboard use std::fs::OpenOptions;.

A screenshot of the newly added button:

Screenshot from 2021-03-31 22-12-12

A screenshot after it was clicked:

Screenshot from 2021-03-31 22-15-31

r? @Nemo157

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Mar 31, 2021
@rust-highfive
Copy link
Collaborator

A change occurred in the Ayu theme.

cc @Cldfire

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

Some changes occurred in HTML/CSS themes.

cc @GuillaumeGomez

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2021
@Nemo157
Copy link
Member

Nemo157 commented Apr 2, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Apr 2, 2021

📌 Commit 828179d has been approved by Nemo157

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 2, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 2, 2021
Rollup of 5 pull requests

Successful merges:

 - rust-lang#83535 (Break when there is a mismatch in the type count)
 - rust-lang#83721 (Add a button to copy the "use statement")
 - rust-lang#83740 (Fix comment typo in once.rs)
 - rust-lang#83745 (Add my new email address to .mailmap)
 - rust-lang#83754 (Add test to ensure search tabs behaviour)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 080aa37 into rust-lang:master Apr 2, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 2, 2021
@GuillaumeGomez GuillaumeGomez deleted the copy-use branch April 2, 2021 15:21
@camelid
Copy link
Member

camelid commented Apr 3, 2021

I just noticed this button. The one issue with the UI as it is now is that it gets in the way of reading the heading text. Maybe a better placement would be next to the [src] button?

@Nemo157
Copy link
Member

Nemo157 commented Apr 3, 2021

Next to the src seems too disconnected, it'd be hard to know what it's going to copy. Maybe the button can be made much less noticeable, removing the border and making it smaller? Maybe even fading the color? Especially on the dark theme it stands out a lot, on light and ayu it's better because the button background is the same as the page background.

@GuillaumeGomez
Copy link
Member Author

Feel free to propose suggestions. I don't have a good "UI opinion" so all good for me. :)

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) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rustdoc should allow copying use statements into clipboard with 1 click
6 participants