canonical/open-documentation-academy

Ubuntu Core docs: Revise code blocks

オープン

#344 opened on 2026/06/15

 (6 件のコメント) (0 件のリアクション) (0 人の担当者)Python (99 件のフォーク)auto 404
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:

  1. Remove all prompt markers ($).
  2. 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 be Removed <snap>.
  3. 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:

https://github.com/canonical/ubuntu-core-docs/blob/main/docs/explanation/refresh-control.md?plain=1#L251-L253

コントリビューターガイド