All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <twoerner@gmail.com>, <docs@lists.yoctoproject.org>
Subject: Re: [docs] [PATCH v2] docs: document the conventions used in the manuals
Date: Tue, 22 Sep 2026 10:09:41 +0200	[thread overview]
Message-ID: <DLLOXO6XJ31D.350CUI499U1BC@bootlin.com> (raw)
In-Reply-To: <20260922013912.55583-1-twoerner@gmail.com>

On Tue Sep 22, 2026 at 3:39 AM CEST, Trevor Woerner via lists.yoctoproject.org wrote:
> The manuals use angle brackets for placeholders and a prompt to mark a
> command, and say so nowhere. A reader can only infer both, and one
> example reads as advice to paste a line that will not parse.
>
> Add a page stating them, in the sidebar beside the other top-level
> entries, so it is reachable from every manual.
>
> AI-Generated: codex/claude-opus 5 (xhigh)
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> ---
> Changes in v2:
> - The page is a document in its own right, reached from a toctree in
>   documentation/index.rst, rather than included into each manual's index.
>   This is Antonin's suggestion and it is the better shape: the page
>   appears in the sidebar of every manual, so a reader meets it wherever
>   they are, and the diff touches two files rather than fifteen.
> - Retitled "Documentation Conventions", which is short enough for the
>   sidebar and matches "Documentation Downloads" beside it. The old title
>   said "this document", which no longer describes a standalone page.
> - The example showing that a leading "#" is a comment is tagged text
>   rather than console. Pygments' console lexer reads a leading "#" as a
>   root prompt and lexes the rest of the line as bash, so v1 rendered that
>   line as a prompt running a command, with the word "command" coloured as
>   a shell builtin - the opposite of what the sentence above it says.
> - Added an opening sentence saying the conventions apply throughout the
>   documentation, since the page is now landed on directly rather than
>   read at the end of a manual.
>
> The wording of both sections is unchanged.
>
>  documentation/conventions.rst | 55 +++++++++++++++++++++++++++++++++++
>  documentation/index.rst       |  7 +++++
>  2 files changed, 62 insertions(+)
>  create mode 100644 documentation/conventions.rst
>
> diff --git a/documentation/conventions.rst b/documentation/conventions.rst
> new file mode 100644
> index 000000000000..469ad5879b51
> --- /dev/null
> +++ b/documentation/conventions.rst
> @@ -0,0 +1,55 @@
> +.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
> +
> +=========================
> +Documentation Conventions
> +=========================
> +
> +These conventions apply throughout the Yocto Project documentation.
> +
> +Placeholders
> +============
> +
> +Text enclosed in angle brackets is a placeholder. Replace it, including the
> +brackets, with a value of your own:
> +
> +.. code-block:: none
> +
> +   SRCREV:pn-<recipe> = "${AUTOREV}"
> +
> +Here, ``<recipe>`` stands for the name of your recipe. A placeholder is
> +never text to be copied as it stands, and an example containing one will
> +not work until every placeholder in it has been replaced.
> +
> +Commands and prompts
> +====================
> +
> +Commands are shown with the prompt that runs them, and the prompt is not
> +part of the command. Do not type it.
> +
> +A ``$`` introduces a command you run as your normal user:
> +
> +.. code-block:: console
> +
> +   $ bitbake core-image-minimal
> +
> +Where a command needs administrative privileges on your build host, it is

s/build host/:term:`build host`/

> +shown with ``sudo`` rather than with a root prompt:
> +
> +.. code-block:: console
> +
> +   $ sudo apt install gawk
> +
> +A full prompt ending in ``#`` introduces a command run as ``root``, usually
> +on a target machine rather than on your build host:

s/build host/:term:`build host`/

> +.. code-block:: console
> +
> +   root@qemux86-64:~# gdb /bin/cat

How about "root@machine:~# " instead? I would rather have a generic machine to
use throughout the documentation than a real example. Unless the context in
which the documentation is written makes sense for a specific machine, of
course. But we should at least have a default name for generic target command
examples.

> +
> +Within an example, a line beginning with ``#`` is a comment rather than a
> +command:
> +
> +.. code-block:: text

Sadly the "console" lexer does not interpret lines starting with "# " as
comments. Would it make sense to use the "shell" lexer instead, in these cases
where commands and comments are mixed?

Antonin


  reply	other threads:[~2026-09-22  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  1:39 [PATCH v2] docs: document the conventions used in the manuals Trevor Woerner
2026-09-22  8:09 ` Antonin Godard [this message]
2026-09-22 11:28   ` [docs] " Trevor Woerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DLLOXO6XJ31D.350CUI499U1BC@bootlin.com \
    --to=antonin.godard@bootlin.com \
    --cc=docs@lists.yoctoproject.org \
    --cc=twoerner@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.