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

Dollar sign exclusion from copy to clipboard snippets #4080

Closed
craigboman opened this issue Oct 24, 2024 · 3 comments
Closed

Dollar sign exclusion from copy to clipboard snippets #4080

craigboman opened this issue Oct 24, 2024 · 3 comments

Comments

@craigboman
Copy link

craigboman commented Oct 24, 2024

Every time I use the markdown copy to clipboard button it copies the entire contents of the code snippet. Every copy to clipboard code example in this entire Rust Book are prefixed with the "$" sign. I completely understand, from a readability standpoint what the $ indicates, but by including this within the contents of the "copy to clipboard" markdown, when copying I then have to also manually delete the "$" before running any code example in my local console. Does the user experience annoyance of having to manually delete each "$" outweigh the readability of having the dollar sign within the "copy to clipboard" markdown? As someone who is currently learning Rust and who is immensely annoyed enough to make this recommendation, I would say yes, but I'm happy to be convinced otherwise.

I'm willing to walk the walk and make these changes globally on a fork PR with a single find/replace change, but I don't want to do all that effort if its unlikely to be accepted by the hardworking community who maintains this repo.

Again, I think this proposal would greatly improve the user experience of not having to delete each dollar sign anytime I want to copy a code snippet to clipboard.

An example of what I'm recommending.

Change this:

$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

To this:

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

Thoughts? Already had this discussion?

@craigboman craigboman changed the title Dollar sign during copy to clipboard Dollar sign exclusion from copy to clipboard snippets Oct 24, 2024
@craigboman
Copy link
Author

craigboman commented Oct 24, 2024

I would also argue, in most cases, we should be using "bash" instead of "console" to give us better markdown syntax highlighting. I'll save that discussion for a later change.

@chriskrycho
Copy link
Contributor

Very much sympathetic here, but yeah, there’s a long history here. Long story short, yep, totally worth solving… upstream in mdbook! However, the one attempt I see upstream got closed in frustration after it sat unresolved for a long time! I’ll nudge the primary mdbook maintainers about what we might do to address it. I’m going to go ahead and close this here, but thanks for the nudge on it!

@chriskrycho chriskrycho closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2024
@chriskrycho
Copy link
Contributor

For reference, I started a Zulip thread about this, as well as leaving a note a few weeks ago on a relevant (closed) PR on mdbook.

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

No branches or pull requests

2 participants