Skip to content

Add copy button to crate version. #130374

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MeetThePatel
Copy link

This PR closes #111143.

Instead of copying strictly the crate version number, this implementation copies a Cargo.toml 'snippet' (the same behavior as the Crates.io copy button). i.e. For a crate called very_useful_crate on version 0.1.0, the copied string would be: very_useful_crate = "0.1.0".

@rustbot
Copy link
Collaborator

rustbot commented Sep 14, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @GuillaumeGomez (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 14, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 14, 2024

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@MeetThePatel MeetThePatel changed the title Add copy button to crate version. (Closes #111143) Add copy button to crate version. Sep 15, 2024
@GuillaumeGomez
Copy link
Member

Looks good overall. Could you add a screenshot please?

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 22, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 22, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust.git master
$ git push --force-with-lease

The following commits are merge commits:

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 22, 2024
@MeetThePatel
Copy link
Author

Hi, apologies about the merge-commit snafu (still new to OSS).

This is the current docs.rs:
image

This is the proposed change:
image

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.......... (130/133)
..F        (133/133)


/checkout/tests/rustdoc-gui/sidebar.goml sidebar... FAILED
[ERROR] `tests/rustdoc-gui/sidebar.goml` line 200: The following errors happened: [different X values: -5.453125 (or -5) != -3]: for command `assert-position: (".sidebar-crate > h2 > a", {"x": -3})`
Error: ()
Build completed unsuccessfully in 0:03:42
  local time: Tue Oct 22 19:18:36 UTC 2024
  network time: Tue, 22 Oct 2024 19:18:36 GMT

@GuillaumeGomez
Copy link
Member

What do you think about this change @notriddle ?

@notriddle
Copy link
Contributor

notriddle commented Oct 23, 2024

Doesn't docs.rs already have a button to do it in its menu bar? Also, the button should be on the baseline, just like it is in the main header.

But the redundancy is the biggest problem. What could we do to make what we already have easier to understand, instead of adding to it?

@bors
Copy link
Collaborator

bors commented Feb 5, 2025

☔ The latest upstream changes (presumably #136564) made this pull request unmergeable. Please resolve the merge conflicts.

@alex-semenyuk
Copy link
Member

alex-semenyuk commented Mar 24, 2025

Triage: comment is not answered and need rebase
@rustbot label: +S-waiting-on-author, -S-waiting-on-review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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: copy version number when click
7 participants