Setup and Building: update code blocks #947
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With output
For blocks showing commands, where there's output shown, it's best to show a
$prompt and useconsoleformatting, so they're shown with formatting:(These PR message examples are shown in Markdown because GitHub, but a similar thing applies to RST in the devguide.)
No output
If there's no output shown, instead of
consoleformatting and a prompt, it's better to usebashwithout a prompt.Here's an example with
consoleand prompts:And
bashwith no prompts:Why?
The biggest usability gain is when clicking the copy button at the right side of the code block: it doesn't include the
$, so you can follow the guide more easily without having to carefully avoid pasting and running a$in your terminal.Details
Because there's only one using
consoleand ~21 usingbash, flip the default to. highlight:: bash.Also -- unrelated but minor -- bump a GitHub Actions version, can drop this if desired.
Preview
Now: https://devguide.python.org/getting-started/setup-building/
PR: https://cpython-devguide--947.org.readthedocs.build/getting-started/setup-building/