diff --git a/documentation/migration-guides/migration-1.3.rst b/documentation/migration-guides/migration-1.3.rst
index 0c378aabe83e..8f79ff74e6e6 100644
--- a/documentation/migration-guides/migration-1.3.rst
+++ b/documentation/migration-guides/migration-1.3.rst
@@ -184,7 +184,9 @@ include :term:`PE` as part of the filename::
 
 Because the :term:`PE` variable is not set by default, these binary files
 could result with names that include two dash characters. Here is an
-example::
+example:
+
+.. code-block:: text
 
    bzImage--3.10.9+git0+cd502a8814_7144bcc4b8-r0-qemux86-64-20130830085431.bin
 
diff --git a/documentation/migration-guides/migration-1.4.rst b/documentation/migration-guides/migration-1.4.rst
index 5d8d0ffde83b..e4856e2eabc9 100644
--- a/documentation/migration-guides/migration-1.4.rst
+++ b/documentation/migration-guides/migration-1.4.rst
@@ -42,7 +42,9 @@ Differences include the following:
 
 -  *Shared State Code:* The shared state code has been optimized to
    avoid running unnecessary tasks. For example, the following no longer
-   populates the target sysroot since that is not necessary::
+   populates the target sysroot since that is not necessary:
+
+   .. code-block:: console
 
       $ bitbake -c rootfs some-image
 
@@ -137,7 +139,9 @@ Target Package Management with RPM
 If runtime package management is enabled and the RPM backend is
 selected, Smart is now installed for package download, dependency
 resolution, and upgrades instead of Zypper. For more information on how
-to use Smart, run the following command on the target::
+to use Smart, run the following command on the target:
+
+.. code-block:: text
 
    smart --help
 
diff --git a/documentation/migration-guides/migration-1.7.rst b/documentation/migration-guides/migration-1.7.rst
index 8527213b80e4..1a4ba2eccb72 100644
--- a/documentation/migration-guides/migration-1.7.rst
+++ b/documentation/migration-guides/migration-1.7.rst
@@ -80,7 +80,9 @@ disable the scripts due to the scripts previously requiring error-prone
 path substitution. Software that links against these libraries using
 these scripts should use the much more robust ``pkg-config`` instead.
 The list of recipes changed in this version (and their configuration
-scripts) is as follows::
+scripts) is as follows:
+
+.. code-block:: text
 
    directfb (directfb-config)
    freetype (freetype-config)
diff --git a/documentation/migration-guides/migration-2.0.rst b/documentation/migration-guides/migration-2.0.rst
index b98f2277ed94..dc4008c691e8 100644
--- a/documentation/migration-guides/migration-2.0.rst
+++ b/documentation/migration-guides/migration-2.0.rst
@@ -92,7 +92,9 @@ unlikely to require any changes to Metadata. However, these minor
 changes in behavior exist:
 
 -  All potential overrides are now visible in the variable history as
-   seen when you run the following::
+   seen when you run the following:
+
+   .. code-block:: console
 
       $ bitbake -e
 
diff --git a/documentation/migration-guides/migration-2.1.rst b/documentation/migration-guides/migration-2.1.rst
index 987464f4d77f..f1c4e7880f26 100644
--- a/documentation/migration-guides/migration-2.1.rst
+++ b/documentation/migration-guides/migration-2.1.rst
@@ -44,7 +44,9 @@ defaulted to False if not specified. Now, however, no default exists so
 one must be specified. You must change any ``getVar()`` calls that do
 not specify the final expand parameter to calls that do specify the
 parameter. You can run the following ``sed`` command at the base of a
-layer to make this change::
+layer to make this change:
+
+.. code-block:: console
 
    $ sed -e 's:\(\.getVar([^,()]*\)):\1, False):g' -i `grep -ril getVar *`
    $ sed -e 's:\(\.getVarFlag([^,()]*,[^,()]*\)):\1, False):g' -i `grep -ril getVarFlag *`
@@ -367,7 +369,9 @@ These additional changes exist:
 -  Previously, the following list of packages were removed if
    package-management was not in
    :term:`IMAGE_FEATURES`, regardless of any
-   dependencies::
+   dependencies:
+
+   .. code-block:: text
 
       update-rc.d
       base-passwd
diff --git a/documentation/migration-guides/migration-2.2.rst b/documentation/migration-guides/migration-2.2.rst
index 9d50dc62022b..a85ce04df8af 100644
--- a/documentation/migration-guides/migration-2.2.rst
+++ b/documentation/migration-guides/migration-2.2.rst
@@ -145,7 +145,9 @@ The new ``runqemu`` is a Python script. Machine knowledge is no longer
 hardcoded into ``runqemu``. You can choose to use the ``qemuboot``
 configuration file to define the BSP's own arguments and to make it
 bootable with ``runqemu``. If you use a configuration file, use the
-following form::
+following form:
+
+.. code-block:: text
 
    image-name-machine.qemuboot.conf
 
@@ -160,7 +162,9 @@ rootfs). QEMU boot arguments can be set in BSP's configuration file and
 the ``qemuboot`` class will save them to ``qemuboot.conf``.
 
 If you want to use ``runqemu`` without a configuration file, use the
-following command form::
+following command form:
+
+.. code-block:: console
 
    $ runqemu machine rootfs kernel [options]
 
@@ -178,12 +182,16 @@ Supported machines are as follows:
 
 Consider the
 following example, which uses the ``qemux86-64`` machine, provides a
-root filesystem, provides an image, and uses the ``nographic`` option::
+root filesystem, provides an image, and uses the ``nographic`` option:
+
+.. code-block:: console
 
    $ runqemu qemux86-64 tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.ext4 tmp/deploy/images/qemux86-64/bzImage nographic
 
 Here is a list of variables that can be set in configuration files
-such as ``bsp.conf`` to enable the BSP to be booted by ``runqemu``::
+such as ``bsp.conf`` to enable the BSP to be booted by ``runqemu``:
+
+.. code-block:: text
 
    QB_SYSTEM_NAME: QEMU name (e.g. "qemu-system-i386")
    QB_OPT_APPEND: Options to append to QEMU (e.g. "-show-cursor")
diff --git a/documentation/migration-guides/migration-2.3.rst b/documentation/migration-guides/migration-2.3.rst
index 60340b9592f1..b67cbdd4e2a5 100644
--- a/documentation/migration-guides/migration-2.3.rst
+++ b/documentation/migration-guides/migration-2.3.rst
@@ -116,7 +116,9 @@ Changes to Scripts
 The following changes to scripts took place:
 
 -  ``oe-find-native-sysroot``: The usage for the
-   ``oe-find-native-sysroot`` script has changed to the following::
+   ``oe-find-native-sysroot`` script has changed to the following:
+
+   .. code-block:: console
 
       $ . oe-find-native-sysroot recipe
 
@@ -125,7 +127,9 @@ The following changes to scripts took place:
    was not necessary to provide the script with the command.
 
 -  ``oe-run-native``: The usage for the ``oe-run-native`` script has
-   changed to the following::
+   changed to the following:
+
+   .. code-block:: console
 
       $ oe-run-native native_recipe tool
 
diff --git a/documentation/migration-guides/migration-2.5.rst b/documentation/migration-guides/migration-2.5.rst
index 70946b5e11b4..8f9032d71f05 100644
--- a/documentation/migration-guides/migration-2.5.rst
+++ b/documentation/migration-guides/migration-2.5.rst
@@ -136,11 +136,15 @@ BitBake Changes
    tree" tasks have been removed (e.g. ``fetchall``, ``checkuriall``,
    and the ``*all`` tasks provided by the ``distrodata`` and
    :ref:`ref-classes-archiver` classes). There is a BitBake option to complete this for
-   any arbitrary task. For example::
+   any arbitrary task. For example:
+
+   .. code-block:: console
 
       $ bitbake <target> -c fetchall
 
-   should now be replaced with::
+   should now be replaced with:
+
+   .. code-block:: console
 
       $ bitbake <target> --runall=fetch
 
diff --git a/documentation/migration-guides/migration-2.6.rst b/documentation/migration-guides/migration-2.6.rst
index ecb559dd4c32..c30808a2f572 100644
--- a/documentation/migration-guides/migration-2.6.rst
+++ b/documentation/migration-guides/migration-2.6.rst
@@ -166,7 +166,9 @@ The following changes have been made:
 
       IMAGE_VERSION_SUFFIX = "-${DATETIME}"
 
--  Several variables have changed names for consistency::
+-  Several variables have changed names for consistency:
+
+   .. code-block:: text
 
       Old Variable Name             New Variable Name
       ========================================================
@@ -288,7 +290,9 @@ avoids the ``systemd`` recipe from becoming machine-specific for cases
 where machine-specific configurations need to be applied (e.g. for
 ``qemu*`` machines).
 
-Currently, the new recipe packages the following files::
+Currently, the new recipe packages the following files:
+
+.. code-block:: text
 
    ${sysconfdir}/machine-id
    ${sysconfdir}/systemd/coredump.conf
diff --git a/documentation/migration-guides/migration-3.4.rst b/documentation/migration-guides/migration-3.4.rst
index e9cb3a109ea9..279c9b56425e 100644
--- a/documentation/migration-guides/migration-3.4.rst
+++ b/documentation/migration-guides/migration-3.4.rst
@@ -67,7 +67,9 @@ may be the same as a :term:`DISTRO` override causing some confusion. We do
 plan to try and improve consistency as these issues are identified.
 
 To help with migration of layers, a script has been provided in OE-Core.
-Once configured with the overrides used by a layer, this can be run as::
+Once configured with the overrides used by a layer, this can be run as:
+
+.. code-block:: text
 
    <oe-core>/scripts/contrib/convert-overrides.py <layerdir>
 
diff --git a/documentation/migration-guides/migration-4.0.rst b/documentation/migration-guides/migration-4.0.rst
index 31ce15a9cafc..0a3766a8a76d 100644
--- a/documentation/migration-guides/migration-4.0.rst
+++ b/documentation/migration-guides/migration-4.0.rst
@@ -65,7 +65,9 @@ A :oe_git:`convert-variable-renames.py
 script is provided to convert your recipes and configuration,
 and also warns you about the use of problematic words. The script performs
 changes and you need to review them before committing. An example warning
-looks like::
+looks like:
+
+.. code-block:: text
 
     poky/scripts/lib/devtool/upgrade.py needs further work at line 275 since it contains abort
 
@@ -254,7 +256,9 @@ Miscellaneous changes
   these with ``cortexa72`` and ``cortexa72-crypto`` respectively.
 
 - The Python development shell (previously known as ``devpyshell``) feature has been
-  renamed to ``pydevshell``. To start it you should now run::
+  renamed to ``pydevshell``. To start it you should now run:
+
+  .. code-block:: console
 
      $ bitbake <target> -c pydevshell
 
diff --git a/documentation/migration-guides/migration-4.1.rst b/documentation/migration-guides/migration-4.1.rst
index 2daaffb1db31..f607babb8efe 100644
--- a/documentation/migration-guides/migration-4.1.rst
+++ b/documentation/migration-guides/migration-4.1.rst
@@ -166,11 +166,15 @@ Miscellaneous changes
   :ref:`ref-classes-archiver` class then you may need to adjust it to
   the new structure.
 - If you are not using `systemd` then udev is now configured to use labels
-  (``LABEL`` or ``PARTLABEL``) to set the mount point for the device. For example::
+  (``LABEL`` or ``PARTLABEL``) to set the mount point for the device. For example:
+
+  .. code-block:: text
 
     /run/media/rootfs-sda2
 
-  instead of::
+  instead of:
+
+  .. code-block:: text
 
     /run/media/sda2
 
diff --git a/documentation/migration-guides/migration-5.2.rst b/documentation/migration-guides/migration-5.2.rst
index 0c888136494e..522a234af771 100644
--- a/documentation/migration-guides/migration-5.2.rst
+++ b/documentation/migration-guides/migration-5.2.rst
@@ -85,7 +85,9 @@ systemd changes
    the other service files were automatically added to the :term:`FILES` variable of
    the same package. Example:
 
-   a.service contains::
+   a.service contains:
+
+   .. code-block:: ini
 
       [Install]
       Also=b.service
@@ -130,7 +132,9 @@ key toolchain providers listed in ``BB_VIRTUAL_RECIPE_PROVIDERS``. As part of
 that support, the ``cross`` providers were simplified to remove the triplet
 prefix (:term:`TARGET_PREFIX`, :term:`SDK_PREFIX` and :term:`HOST_PREFIX`) and
 generalise the naming. Here are examples of how references to these variables
-can be changed to use the new ``cross`` syntax::
+can be changed to use the new ``cross`` syntax:
+
+.. code-block:: text
 
    virtual/${HOST_PREFIX}binutils -> virtual/cross-binutils
    virtual/${TARGET_PREFIX}binutils -> virtual/cross-binutils
@@ -145,7 +149,9 @@ can be changed to use the new ``cross`` syntax::
 
    virtual/${TARGET_PREFIX}g++ -> virtual/cross-c++
 
-A :term:`PREFERRED_PROVIDER` assignment can be transformed as follows::
+A :term:`PREFERRED_PROVIDER` assignment can be transformed as follows:
+
+.. code-block:: text
 
    PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils -> PREFERRED_PROVIDER_virtual/cross-binutils
    PREFERRED_PROVIDER_virtual/${SDK_PREFIX}binutils -> PREFERRED_PROVIDER_virtual/cross-binutils:class-nativesdk
diff --git a/documentation/migration-guides/migration-5.3.rst b/documentation/migration-guides/migration-5.3.rst
index e5521d94b59f..ec5ae049908c 100644
--- a/documentation/migration-guides/migration-5.3.rst
+++ b/documentation/migration-guides/migration-5.3.rst
@@ -81,16 +81,22 @@ How to make those adjustments without tedious manual editing
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The following sed command can be used to remove S = "${WORKDIR}/git
-across a whole layer::
+across a whole layer:
+
+.. code-block:: console
 
    $ sed -i "/^S = \"\${WORKDIR}\/git\"/d" `find . -name '*.bb' -o -name '*.inc' -o -name '*.bbclass'`
 
 Then, the following command can tweak the remaining :term:`S` assignments to
-refer to :term:`UNPACKDIR` instead of :term:`WORKDIR`::
+refer to :term:`UNPACKDIR` instead of :term:`WORKDIR`:
+
+.. code-block:: console
 
    $ sed -i "s/^S = \"\${WORKDIR}\//S = \"\${UNPACKDIR}\//g" `find . -name '*.bb' -o -name '*.inc' -o -name '*.bbclass'`
 
-The first change can introduce a lot of consecutive empty lines, so those can be removed with::
+The first change can introduce a lot of consecutive empty lines, so those can be removed with:
+
+.. code-block:: console
 
    $ sed -i -z -E 's/([ \t\f\v\r]*\n){3,}/\n\n/g' `find . -name '*.bb' -o -name '*.inc'`
 
@@ -108,7 +114,9 @@ Space around equal assignment
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 A new warning is now printed when there are no whitespaces around an ``=``
-assignment in recipes::
+assignment in recipes:
+
+.. code-block:: text
 
    <filename>:<line number> has a lack of whitespace around the assignment: '<assignment>'
 
@@ -310,11 +318,15 @@ The following classes have been removed in this release:
          KERNEL_CLASSES += "kernel-fit-extra-artifacts"
 
    #. Use the specific FIT image recipe rather than the base kernel recipe.
-      For example, instead of::
+      For example, instead of:
+
+      .. code-block:: console
 
          $ bitbake linux-yocto
 
-      the FIT image is now build by::
+      the FIT image is now build by:
+
+      .. code-block:: console
 
          $ bitbake linux-yocto-fitimage
 
diff --git a/documentation/migration-guides/migration-6.0.rst b/documentation/migration-guides/migration-6.0.rst
index 5ad284600002..2eb6de90c684 100644
--- a/documentation/migration-guides/migration-6.0.rst
+++ b/documentation/migration-guides/migration-6.0.rst
@@ -261,12 +261,16 @@ See commit :oecore_rev:`68d2d38483efada7bc2409e10508b03a7431caff` for more infor
 Image recipes that inherit the :ref:`ref-classes-vex` class have an extra JSON
 document generated which was previously ending with the ``.json`` suffix. For
 example, a build for the ``core-image-minimal`` image recipe with this class
-inherited would have resulted in a file named::
+inherited would have resulted in a file named:
+
+.. code-block:: text
 
    core-image-minimal-qemuarm64.rootfs.json
 
 The suffix of this file is now ``.vex.json``. Taking the above example, the same
-file is now named::
+file is now named:
+
+.. code-block:: text
 
    core-image-minimal-qemuarm64.rootfs.vex.json
 
@@ -276,7 +280,7 @@ Support for SPDX 2.2 removed
 Support for generating SPDX 2.2 document through the ``create-spdx-2.2`` class
 was removed:
 
-.. code-block::
+.. code-block:: text
 
    Removes SPDX 2.2 support in favor of SPDX 3 support being the only
    option. The SPDX 3 data is far superior to SPDX 2.2 and thus more useful
@@ -388,7 +392,9 @@ size of the partitions generated by the :doc:`WIC </dev-manual/wic>` tool. The
 replaces this variable.
 
 While this variable can still be used in recipes, a warning is now printed on
-the console when used::
+the console when used:
+
+.. code-block:: text
 
    DEPRECATED: WIC_SECTOR_SIZE is deprecated, use the --sector-size command-line argument instead.
 
@@ -414,13 +420,17 @@ files) should be moved to the ``files/wic/`` directory of the layer containing
 them.
 
 If not done, the build will fail with errors indicating how to move these files,
-for example::
+for example:
+
+.. code-block:: text
 
    wic/wks files at ../meta-custom/wic need to be moved to files/wic within the layer to be found/used
    wic/wks files at ../meta-custom/scripts/lib/wic/canned-wks need to be moved to files/wic within the layer to be found/used
 
 For example, here is the content of the :term:`OpenEmbedded-Core (OE-Core)`
-"meta" layer as of writing::
+"meta" layer as of writing:
+
+.. code-block:: text
 
    meta/files/wic
    ├── common.wks.inc
diff --git a/documentation/migration-guides/migration-6.1.rst b/documentation/migration-guides/migration-6.1.rst
index 43a02e90cb40..410567c8c8fc 100644
--- a/documentation/migration-guides/migration-6.1.rst
+++ b/documentation/migration-guides/migration-6.1.rst
@@ -65,11 +65,15 @@ The ``oe.utils.all_distro_features()`` and ``oe.utils.any_distro_features()``
 functions have been removed from :term:`OpenEmbedded-Core (OE-Core)`.
 
 Those can be replaced by ``bb.utils.contains()`` and ``bb.utils.contains_any()``
-calls::
+calls:
+
+.. code-block:: text
 
    oe.utils.all_distro_features("x y", ...) -> bb.utils.contains("DISTRO_FEATURES", "x y", ...)
 
-And::
+And:
+
+.. code-block:: text
 
    oe.utils.any_distro_features("x y", ...) -> bb.utils.contains_any("DISTRO_FEATURES", "x y", ...)
 
diff --git a/documentation/migration-guides/release-notes-4.2.rst b/documentation/migration-guides/release-notes-4.2.rst
index 3586622edca9..68bfa41656cd 100644
--- a/documentation/migration-guides/release-notes-4.2.rst
+++ b/documentation/migration-guides/release-notes-4.2.rst
@@ -171,7 +171,9 @@ New Features / Enhancements in 4.2
       which is a thin wrapper over :oe_git:`resulttool
       </openembedded-core/tree/scripts/resulttool>`. Here is an example
       command, which allowed to spot and fix a regression in the
-      ``quilt`` ptest::
+      ``quilt`` ptest:
+
+      .. code-block:: console
 
          $ yocto_testresults_query.py regression-report 4.2_M1 4.2_M2
 
diff --git a/documentation/migration-guides/release-notes-5.1.rst b/documentation/migration-guides/release-notes-5.1.rst
index dc770ebc39b6..01bef9234e76 100644
--- a/documentation/migration-guides/release-notes-5.1.rst
+++ b/documentation/migration-guides/release-notes-5.1.rst
@@ -166,7 +166,9 @@ New Features / Enhancements in 5.1
 
    -  ``fetcher2``: remote name for ``git://`` is now ``origin`` by default.
 
-   -  Codeparser now supports shell substitution in quotes, for example::
+   -  Codeparser now supports shell substitution in quotes, for example:
+
+      .. code-block:: shell
 
          var1="$(cmd1 ...)"
 
diff --git a/documentation/migration-guides/release-notes-5.3.rst b/documentation/migration-guides/release-notes-5.3.rst
index 311a9a94718a..8a5554d88ae9 100644
--- a/documentation/migration-guides/release-notes-5.3.rst
+++ b/documentation/migration-guides/release-notes-5.3.rst
@@ -85,7 +85,9 @@ New Features / Enhancements in |yocto-ver|
       Listing these built-in fragments can be done with
       :oe_git:`bitbake-config-build
       list-fragments</bitbake/tree/bin/bitbake-config-build>`, which could
-      list::
+      list:
+
+      .. code-block:: text
 
          Available built-in fragments:
          machine/...     Sets MACHINE = ...
@@ -257,7 +259,9 @@ New Features / Enhancements in |yocto-ver|
       https://web.archive.org/web/20240420122324/https://www.linuxkernelcves.com/).
 
    -  ``kernel-yocto``: allow annotated options to be modified. For example if
-      the following kernel configuration is set::
+      the following kernel configuration is set:
+
+      .. code-block:: ini
 
          CONFIG_INET_TUNNEL=y # OVERRIDE:$MODULE_OR_Y
 
@@ -464,7 +468,9 @@ New Features / Enhancements in |yocto-ver|
    -  ``runqemu``:
 
       -  The script can now run compressed images with snapshot mode. For
-         example, with :term:`IMAGE_FSTYPES` containing ``ext4.zst``, you can run::
+         example, with :term:`IMAGE_FSTYPES` containing ``ext4.zst``, you can run:
+
+         .. code-block:: console
 
             $ runqemu snapshot ext4.zst <image-recipe>
 
@@ -704,7 +710,9 @@ New Features / Enhancements in |yocto-ver|
    -  When using the ``ipk`` and ``rpm`` package managers, give out more possible
       reasons about unmatched packages.
 
-      For example::
+      For example:
+
+      .. code-block:: text
 
          E: Package 'catch2' has no installation candidate
          catch2 is a recipe. Its generated packages are: ['catch2-src', 'catch2-dbg', 'catch2-staticdev', 'catch2-dev', 'catch2-doc']
