Yocto Project Documentation
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: docs@lists.yoctoproject.org
Subject: [PATCH 16/16] standards: describe how a code block states its language
Date: Tue,  1 Dec 2026 10:22:49 -0500	[thread overview]
Message-ID: <20261201152251.2742634-17-twoerner@gmail.com> (raw)
In-Reply-To: <20261201152251.2742634-1-twoerner@gmail.com>

The manuals highlight a code block as BitBake unless it says otherwise,
which is a rule a contributor can only discover by reading conf.py.
Write it down, along with the languages the other blocks use and what to
do with a block the BitBake lexer cannot read.

AI-Generated: codex/claude-opus 5.5 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 documentation/standards.md | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/documentation/standards.md b/documentation/standards.md
index 152a90923401..2614220ef0e1 100644
--- a/documentation/standards.md
+++ b/documentation/standards.md
@@ -134,6 +134,28 @@ Note that only "absolute" paths (starting with a '/') are allowed. The root
 directory of that path is documentation/, that is, :doc:`/bsp-manual/index`
 points at documentation/bsp-manual/index.rst.
 
+### Code blocks
+
+A code block is highlighted as BitBake unless it says otherwise, because
+most of the code in the manuals is BitBake metadata. A block of anything
+else states its language:
+
+    .. code-block:: console
+
+       $ bitbake core-image-minimal
+
+Use the language the block actually is, not the one it resembles. A
+session with a prompt is `console`, a script without one is `shell`, and
+a listing of paths or program output is `text`.
+
+If the BitBake lexer cannot read a valid BitBake block, show it as `text`
+and say why in a comment above it, so it can be switched back once the
+lexer is fixed:
+
+    .. Shown as text: the Pygments BitBake lexer misreads this block.
+
+    .. code-block:: text
+
 ## Adding screenshots
 
 The preferred format for adding screenshots is
-- 
2.50.0.173.g8b6f19ccfc3a


      parent reply	other threads:[~2026-12-01 15:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 15:22 [PATCH 00/16] docs: highlight code blocks as BitBake by default Trevor Woerner
2026-12-01 15:22 ` [PATCH 01/16] brief-yoctoprojectqs: state the language of the blocks that are not BitBake Trevor Woerner
2026-12-01 15:22 ` [PATCH 02/16] bsp-manual: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 03/16] contributor-guide: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 04/16] dev-manual: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 05/16] kernel-dev: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 06/16] migration-guides: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 07/16] overview-manual: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 08/16] profile-manual: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 09/16] ref-manual: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 10/16] security-manual: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 11/16] test-manual: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 12/16] toaster-manual: " Trevor Woerner
2026-12-01 15:22 ` [PATCH 13/16] docs: show the examples the BitBake lexer misreads as text Trevor Woerner
2026-12-01 15:22 ` [PATCH 14/16] docs: drop the file-wide highlight directives Trevor Woerner
2026-12-01 15:22 ` [PATCH 15/16] conf.py: default the highlight language to bitbake Trevor Woerner
2026-12-01 15:22 ` Trevor Woerner [this message]

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=20261201152251.2742634-17-twoerner@gmail.com \
    --to=twoerner@gmail.com \
    --cc=docs@lists.yoctoproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox