canonical/open-documentation-academy
Ubuntu Core docs: Revise code blocks
オープン
#344 opened on 2026/06/15
codeeditgood first issuesize 3
Repository metrics
- Stars
- (119 個のスター)
- PR merge metrics
- (PR metrics pending)
説明
Situation
The Ubuntu Core docs have code blocks that don't follow the best practices, which impacts the reader's experience, such as the result when they copy a code block. It also impacts the writer's experience, in that the document sources are inconsistent and more difficult to read.
Request
We would like to revise every code block in the docs. This task involves fine-tuning the source for the documents, and searching through the files.
The general approach would be:
- Remove all prompt markers (
$). - For each command, assess the suitability of the output text and remove it if it adds no value. If the command prints the default result, or shows the user only predictable and easy-to-anticipate text, then it adds no value. An example of predictable text would be: if the command were
snap remove <snap>, the predictable output would beRemoved <snap>.- If the output is needed, then the code block should be converted into a
terminaldirective. - If the output isn't needed, use Markdown code blocks.
- If the output is needed, then the code block should be converted into a
- Set the language for all blocks to
bash.
When searching the repository, there are a few patterns you should look for that produce code blocks:
Here's an example of a good existing code block in the docs: