From 50c63e75c32cb65889ed84d389543d2aa6b5f46f Mon Sep 17 00:00:00 2001 From: Coca Date: Sun, 27 Sep 2026 11:22:14 +0200 Subject: [PATCH] doc/styleguide: separate quoted examples to render as multiple lines Github's markdown renderer combines multi-line quotes into one line leading to an incredible amount of confusion. Adding a new line between them fixes this. --- doc/styleguide.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/doc/styleguide.md b/doc/styleguide.md index 8649548f52c2..1043bb4275a3 100644 --- a/doc/styleguide.md +++ b/doc/styleguide.md @@ -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: ``, ``, ``.