Skip to content

Conversation

@thaJeztah
Copy link
Member

relates to #5380 and #5282 (and others)

Prevent selecting comments, command-output and command-prompt in shell
examples that use the "console" lexer/highlighter to allow easier copying.
See rouge-ruby/rouge#1023

The "comment" and "command-output" non-selectable may be ones we need to keep an eye on, to check if it properly detects commands from "output" and "comments"

Before this:

Screenshot 2021-03-02 at 13 50 06

After this:

Screenshot 2021-03-02 at 15 06 16

This tones down the prompt and command output, so that the commands
to run stand out more clearly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This was only included in some distributions, so adding it to all
pages.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Prevent selecting comments, command-output and command-prompt in shell
examples that use the "console" lexer/highlighter to allow easier copying.
See rouge-ruby/rouge#1023

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@netlify
Copy link

netlify bot commented Mar 2, 2021

Deploy preview for docsdocker ready!

Built with commit 19b3b40

https://deploy-preview-12425--docsdocker.netlify.app

@thaJeztah
Copy link
Member Author

Also can use https://rouge-ruby.github.io/docs/Rouge/Lexers/ConsoleLexer.html to force specific shell highlighting, e.g.;

```console?lang=powershell

Show a "text" cursor for the prompt. Even though the prompt itself is not
selectable, make it appear as if it is, so that users don't get confused
when they try to select an example for copying.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

@usha-mandya updated; I pushed a change to make the prompt itself have a "text" cursor, as discussed

@usha-mandya
Copy link
Member

Thanks @thaJeztah. Happy with the improvements We can fix the prompt appearing when copy/pasting two blocks in a subsequent patch.

Copy link
Member

@usha-mandya usha-mandya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@usha-mandya usha-mandya merged commit 784b79c into docker:master Mar 2, 2021
@thaJeztah thaJeztah deleted the copy_pasta branch March 2, 2021 16:06
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.

2 participants