Showing a command prompt character can be useful for users to aid recognition and build familiarity that “yes, I am on the right track”.
Care should be taken to avoid the command prompt character being accidentally selected if the code is copied, as pasting the command prompt as part of the command will cause an error.
Anatomy
Usage
The command prompt should be shown only if the code is to be run on a command line - rather than example code to be part of a codebase. It’s a visual aid for the user to understand that this code should be (for example) executed line-by-line rather than included in another project.
States & Behaviours
A character in the Vanilla monospace font, ahead of the code snippet, but not selected on;
- Drag-select
- Triple-click (line select)
- Command / Control - A
The character itself can be specified in the markdown/schema for the example, but the code author can optionally leave it blank and no command prompt will be shown.
Each code example (code “version” - as controlled by the version switcher) can optionally have its own command prompt (for example “>
” on Windows).