doc/styleguide: separate quoted examples to render as multiple lines (#567393)

This commit is contained in:
Johannes Kirschbauer
2026-10-03 13:42:26 +00:00
committed by GitHub

View File

@@ -90,13 +90,13 @@ Don't describe what the documentation does. Just do it.
**Don't:**
> This section explains how to configure networking.
>
> The following guide walks you through setting up a web server.
**Do:**
> Configure networking by setting:
>
> Set up a web server:
### Code examples
@@ -193,13 +193,17 @@ Use sentence case. A reader scanning only headings should understand the page.
**Don't:**
> Getting Started
>
> Overview
>
> Configure The Database
**Do:**
> Set up a PostgreSQL database
>
> Configure networking
>
> Add a user to the system
### Imperative mood, voice, and person
@@ -209,13 +213,17 @@ Use imperative mood for instructions. Address the reader as "you", not "the user
**Don't:**
> The user should run the following command.
>
> The configuration will need to be updated.
>
> The key is generated by the system.
**Do:**
> Run the command.
>
> Update the configuration.
>
> The system generates the key.
### Tense
@@ -225,11 +233,13 @@ Use present tense for descriptions. Future tense makes documentation feel tentat
**Don't:**
> This will create a new folder.
>
> Running this command will install the package.
**Do:**
> This creates a new folder.
>
> Running this command installs the package.
### Be confident
@@ -239,11 +249,13 @@ State facts. Don't hedge with "should," "might," "typically," or "usually" unles
**Don't:**
> This should create the configuration file.
>
> The service will usually start automatically.
**Do:**
> This creates the configuration file.
>
> The service starts automatically.
### Avoid nominalizations
@@ -253,11 +265,13 @@ A nominalization is a verb turned into a noun, often by adding *-tion*, *-meant*
**Don't:**
> Make a selection from the list.
>
> Provide an explanation of the error.
**Do:**
> Select from the list.
>
> Explain the error.
### Plain words
@@ -287,13 +301,17 @@ Delete on sight:
**Don't:**
> Simply run `nixos-rebuild switch`.
>
> In order to deploy, you first need to run the command, which allows you to push the config.
>
> It's worth noting that this requires root access.
**Do:**
> Run `nixos-rebuild switch`.
>
> To deploy, run:
>
> This requires root access.
Every word must earn its place.
@@ -341,18 +359,20 @@ Use descriptive link text. Never use "click here" or "this link."
**Don't:**
> For more information, see `[this page](url)`.
>
> Click `[here](url)` to read the reference.
**Do:**
> See the `[NixOS options reference](url)` for details.
>
> Read the `[NixOS module system guide](url)`.
Only link when the destination is directly relevant, not for generic background context (sometimes known as "Wikipedia-style links"). Readers feel obligated to click links, fearing they'll miss something important. Don't send them to a generic article about a technology when they're looking for how *your* system uses it.
**Don't:**
> Our software uses [SQLite](https://sqlite.org/) for storage.
> Our software uses [SQLite](https://sqlite.org/) for storage.\
> *(Reader clicks expecting schema details — finds a generic product page instead.)*
(Note that in the above example, the SQLite link is the SQLite home page, which is likely not pertinent.)
@@ -368,11 +388,13 @@ Match UI element names exactly: wording, casing, and spacing (even if a label se
**Don't:**
> Click the generator button.
>
> Select the save option.
**Do:**
> Click **Generate a Key**.
>
> Click **Save Changes**.
Someone will go looking for a button labeled "generator." They will not find it. They will be frustrated.
@@ -406,11 +428,13 @@ Always copy commands and code from a terminal where you just ran them successful
**Don't:**
> Retype a command from memory into the documentation.
>
> Retype code into a code-block from memory
**Do:**
> Paste commands directly from the shell or IDE.
>
> Paste code that has been successfully validated with nix-instantiate or nix-build
Replace sensitive values with placeholders: `<YOUR-KEY>`, `<YOUR-HOST>`, `<YOUR-TOKEN>`.