cognitive-engineering-lab / rust-book

The Rust Programming Language: Experimental Edition
https://rust-book.cs.brown.edu
Other
653 stars 101 forks source link

Copy to clipboard function is hard to use when prompt character is included #131

Open bflaton opened 1 year ago

bflaton commented 1 year ago

URL to the section(s) of the book with this problem: src/ch01-01-installation.md, but other chapters may suffer from the same

Description of the problem: Current shell commands listed in the installation chapter include the shell prompt, presumably for readibility. Yet, even though this fact is explained at the start of the chapter, it still makes the "copy to clipboard" function annoying to use and I find myself manually selecting the command and copy/pasting. I think readers are better served with the ability to use the "copy to clipboard" at the expense of not showing some command prompt character (which looks different on my linux distro anyway).

Suggested fix: Remove any "prompt characters" from the shell commands, so that the full content of the command block can just be copy/pasted.

bflaton commented 1 year ago

If you leave an indication that a change like this would be accepted, I'll consider opening a PR with the changes in it. But it's always good to ask in advance IMO :-)

hamirmahal commented 12 months ago

https://github.com/rust-lang/mdBook/pull/1346 might be related.

hamirmahal commented 12 months ago

Same as https://github.com/rust-lang/book/issues/3307

willcrichton commented 11 months ago

I think it's valuable to visually telegraph the use of a shell command. I would prefer this be fixed on the mdbook side rather than the Rust Book side.

willcrichton commented 11 months ago

Conversely: if mdbook somehow made this behavior possible, even through configuration, I would be happy to add that configuration.