Skip to contentSkip to conversation

be consistent across all local :doc: references

PATCH Applied Quentin Schulz 2 participants 4 messages Jun 18, 2025 – Jun 24, 2025

lore
Share & tools
lore
#0 lore raw

cover be consistent across all local :doc: references

The doc directive[1] allows multiple paths:
- relative to the current document
- relative to the current document going through the parent directory (e.g. via ../)
- "absolute" (paths starting with /), relative to the root directory (which is documentation/ for yocto-docs),

This attempts at making the use of local :doc: directive consistent across the whole tree by changing (and encouraging) all paths to be "absolute" paths.

meld doesn't report any change in the HTML output after this series applied.

[1] https://www.sphinx-doc.org/en/master/usage/referencing.html#role-doc

---
Quentin Schulz (2):
tree-wide: make the :doc: directive use absolute paths document how to use :doc: directive

 documentation/README                                      | 10 ++++++++++
 documentation/bsp-guide/bsp.rst                           |  4 ++--
 documentation/contributor-guide/submit-changes.rst        |  4 ++--
 documentation/dev-manual/building.rst                     |  4 ++--
 documentation/dev-manual/debugging.rst                    |  4 ++--
 documentation/dev-manual/new-recipe.rst                   |  2 +-
 documentation/dev-manual/start.rst                        |  2 +-
 documentation/dev-manual/vulnerabilities.rst              |  2 +-
 documentation/migration-guides/release-notes-4.3.rst      |  4 ++--
 documentation/overview-manual/development-environment.rst |  6 +++---
 documentation/ref-manual/resources.rst                    |  4 ++--
 documentation/ref-manual/system-requirements.rst          |  2 +-
 documentation/ref-manual/variables.rst                    |  2 +-
 documentation/standards.md                                | 11 ++++++++++-
 documentation/transitioning-to-a-custom-environment.rst   |  4 ++--
 documentation/what-i-wish-id-known.rst                    |  4 ++--
 16 files changed, 44 insertions(+), 25 deletions(-)

---
base-commit: b13bccbf3fb1890ac428a396f8c5081057edf555
change-id: 20250618-doc-abs-path-572e8275517d

Best regards,

Signature · 1 line
Quentin Schulz <[email protected]>
#1 lore raw

PATCH 1/2 tree-wide: make the :doc: directive use absolute paths

From: Quentin Schulz <[email protected]>

This makes all :doc: directives use an absolute paths (with the root directory being documentation/ in the repo).

This is then consistent across the whole source and is easier to review and move files around, you just need to know where a file is located relative to documentation/ directory and use that.

This gets rid of paths looking in parent directory with '..' as well as expecting a file to be in the same directory as the other file it points to via the :doc: directive.

---
 documentation/bsp-guide/bsp.rst                           | 4 ++--
 documentation/contributor-guide/submit-changes.rst        | 4 ++--
 documentation/dev-manual/building.rst                     | 4 ++--
 documentation/dev-manual/debugging.rst                    | 4 ++--
 documentation/dev-manual/new-recipe.rst                   | 2 +-
 documentation/dev-manual/start.rst                        | 2 +-
 documentation/dev-manual/vulnerabilities.rst              | 2 +-
 documentation/migration-guides/release-notes-4.3.rst      | 4 ++--
 documentation/overview-manual/development-environment.rst | 6 +++---
 documentation/ref-manual/resources.rst                    | 4 ++--
 documentation/ref-manual/system-requirements.rst          | 2 +-
 documentation/ref-manual/variables.rst                    | 2 +-
 documentation/transitioning-to-a-custom-environment.rst   | 4 ++--
 documentation/what-i-wish-id-known.rst                    | 4 ++--
 14 files changed, 24 insertions(+), 24 deletions(-)
documentation/bsp-guide/bsp.rst +2 -2
index 35972f1726986a1366683674c3af3d1dfb8e0a65..92e3a6e1c80f84899f8cd44fa53b0a5590e0d314 100644
@@ -876,7 +876,7 @@ The requirements for a released BSP that conform to the Yocto Project are:
    ``recipes-*`` subdirectories specific to the recipe's function, or
    within a subdirectory containing a set of closely-related recipes.
    The recipes themselves should follow the general guidelines for
-   recipes found in the ":doc:`../contributor-guide/recipe-style-guide`"
+   recipes found in the ":doc:`/contributor-guide/recipe-style-guide`"
    in the Yocto Project and OpenEmbedded Contributor Guide.
 
 -  *License File:* You must include a license file in the
@@ -910,7 +910,7 @@ The requirements for a released BSP that conform to the Yocto Project are:
    -  The name and contact information for the BSP layer maintainer.
       This is the person to whom patches and questions should be sent.
       For information on how to find the right person, see the
-      :doc:`../contributor-guide/submit-changes` section in the Yocto Project and
+      :doc:`/contributor-guide/submit-changes` section in the Yocto Project and
       OpenEmbedded Contributor Guide.
 
    -  Instructions on how to build the BSP using the BSP layer.
documentation/contributor-guide/submit-changes.rst +2 -2
index 6d5d69d7cfb45b5618e24c345b226f0495b116ef..adb78fa08d8ec783ccdabff41a3ea69f16e7e3a0 100644
@@ -76,7 +76,7 @@ Clone the Git repository for the component to modify
 ----------------------------------------------------
 
 After identifying the component to modify as described in the
-":doc:`../contributor-guide/identify-component`" section, clone the
+":doc:`/contributor-guide/identify-component`" section, clone the
 corresponding Git repository. Here is an example for OpenEmbedded-Core::
 
   git clone https://git.openembedded.org/openembedded-core
@@ -872,7 +872,7 @@ in regards to the use of generative AI tools. See:
 https://www.linuxfoundation.org/legal/generative-ai.
 
 All of the existing guidelines in this document are expected to be followed,
-including in the :doc:`recipe-style-guide`, and contributing the changes with
+including in the :doc:`/contributor-guide/recipe-style-guide`, and contributing the changes with
 additional requirements to the items in section
 :ref:`contributor-guide/submit-changes:Implement and commit changes`.
 
documentation/dev-manual/building.rst +2 -2
index 807c665f68dce61440cb8116b82714df71c41193..865d2e1b672284db6563f7b56fdc6b94b7958522 100644
@@ -48,7 +48,7 @@ The following figure and list overviews the build process:
    :width: 100%
 
 #. *Set up Your Host Development System to Support Development Using the
-   Yocto Project*: See the ":doc:`start`" section for options on how to get a
+   Yocto Project*: See the ":doc:`/dev-manual/start`" section for options on how to get a
    build host ready to use the Yocto Project.
 
 #. *Initialize the Build Environment:* Initialize the build environment
@@ -113,7 +113,7 @@ The following figure and list overviews the build process:
 Building Images for Multiple Targets Using Multiple Configurations
 ==================================================================
 
-See the :doc:`multiconfig` section of the Yocto Project Development Tasks
+See the :doc:`/dev-manual/multiconfig` section of the Yocto Project Development Tasks
 Manual.
 
 Building an Initial RAM Filesystem (Initramfs) Image
documentation/dev-manual/debugging.rst +2 -2
index 8552b26aea9059446b5b4346ae7ef1f84e5750c1..6c45ccf652793b9697da75efb015d6d56cabe124 100644
@@ -890,7 +890,7 @@ The build should work without issue.
 As with all solved problems, if they originated upstream, you need to
 submit the fix for the recipe in OE-Core and upstream so that the
 problem is taken care of at its source. See the
-":doc:`../contributor-guide/submit-changes`" section for more information.
+":doc:`/contributor-guide/submit-changes`" section for more information.
 
 Debugging With the GNU Project Debugger (GDB) Remotely
 ======================================================
@@ -1261,7 +1261,7 @@ Here are some other tips that you might find useful:
    :yocto_bugs:`Bugzilla <>`. For information on
    how to submit a bug against the Yocto Project, see the Yocto Project
    Bugzilla :yocto_wiki:`wiki page </Bugzilla_Configuration_and_Bug_Tracking>`
-   and the ":doc:`../contributor-guide/report-defect`" section.
+   and the ":doc:`/contributor-guide/report-defect`" section.
 
    .. note::
 
documentation/dev-manual/new-recipe.rst +1 -1
index 9792bd4c1f647e6186ae74890b32c493eeef3f9c..c49881efe63f74da5205d1af47ddde1c9c69aa48 100644
@@ -1401,7 +1401,7 @@ Following Recipe Style Guidelines
 =================================
 
 When writing recipes, it is good to conform to existing style guidelines.
-See the ":doc:`../contributor-guide/recipe-style-guide`" in the Yocto Project
+See the ":doc:`/contributor-guide/recipe-style-guide`" in the Yocto Project
 and OpenEmbedded Contributor Guide for reference.
 
 It is common for existing recipes to deviate a bit from this style.
documentation/dev-manual/start.rst +1 -1
index 73548132a3ff223803a9553b1a0463a521e46fcd..d77da04276bfd03002cbd3497adf4d008c37df58 100644
@@ -234,7 +234,7 @@ particular working environment and set of practices.
     -  The Yocto Project community encourages you to send patches to the
        project to fix bugs or add features. If you do submit patches,
        follow the project commit guidelines for writing good commit
-       messages. See the ":doc:`../contributor-guide/submit-changes`"
+       messages. See the ":doc:`/contributor-guide/submit-changes`"
        section in the Yocto Project and OpenEmbedded Contributor Guide.
 
     -  Send changes to the core sooner than later as others are likely
documentation/dev-manual/vulnerabilities.rst +1 -1
index d901ff975bf7e2cd5f6785e5794a9893a275f696..5331a639919c7d3e52dfe46accaf2a4daa1f7fc2 100644
@@ -22,7 +22,7 @@ issues may be impacting Poky and OE-Core. It is up to the maintainers, users,
 contributors and anyone interested in the issues to investigate and possibly fix them by
 updating software components to newer versions or by applying patches to address them.
 It is recommended to work with Poky and OE-Core upstream maintainers and submit
-patches to fix them, see ":doc:`../contributor-guide/submit-changes`" for details.
+patches to fix them, see ":doc:`/contributor-guide/submit-changes`" for details.
 
 Vulnerability check at build time
 =================================
documentation/migration-guides/release-notes-4.3.rst +2 -2
index 0103ac985ef1ddf6c0722ff118a1967367263881..aa3f31a2ce47792cb923edf8eaf9abcd70cba69d 100644
@@ -272,9 +272,9 @@ New Features / Enhancements in 4.3
 
 -  Prominent documentation updates:
 
-   -  New :doc:`../contributor-guide/index` document.
+   -  New :doc:`/contributor-guide/index` document.
 
-   -  New :doc:`../dev-manual/security-subjects` chapter in the Development
+   -  New :doc:`/dev-manual/security-subjects` chapter in the Development
       Tasks Manual.
 
    -  Long overdue documentation for the :ref:`ref-classes-devicetree` class.
documentation/overview-manual/development-environment.rst +3 -3
index d79173ff55066ff163d09ad955eeee44bdb64287..066d784314cf66190bce733c27fffdc74eee5bac 100644
@@ -240,7 +240,7 @@ and so forth.
 
    For information on finding out who is responsible for (maintains) a
    particular area of code in the Yocto Project, see the
-   ":doc:`../contributor-guide/identify-component`"
+   ":doc:`/contributor-guide/identify-component`"
    section of the Yocto Project and OpenEmbedded Contributor Guide.
 
 The Yocto Project ``poky`` Git repository also has an upstream
@@ -272,7 +272,7 @@ push them into the "contrib" area and subsequently request that the
 maintainer include them into an upstream branch. This process is called
 "submitting a patch" or "submitting a change." For information on
 submitting patches and changes, see the
-":doc:`../contributor-guide/submit-changes`" section in the Yocto Project
+":doc:`/contributor-guide/submit-changes`" section in the Yocto Project
 and OpenEmbedded Contributor Guide.
 
 In summary, there is a single point of entry for changes into the
@@ -347,7 +347,7 @@ Book <https://book.git-scm.com>`__.
    this type of change, you format the patch and then send the email
    using the Git commands ``git format-patch`` and ``git send-email``.
    For information on how to use these scripts, see the
-   ":doc:`../contributor-guide/submit-changes`" section in the Yocto Project
+   ":doc:`/contributor-guide/submit-changes`" section in the Yocto Project
    and OpenEmbedded Contributor Guide.
 
 Git
documentation/ref-manual/resources.rst +2 -2
index 4eaaca942ec3c46968bbc6eb514042f09d5f37a3..bcbc7ebacac89fd49179efef03a3f561fb9396fd 100644
@@ -23,7 +23,7 @@ The Yocto Project gladly accepts contributions. You can submit changes
 to the project either by creating and sending pull requests, or by
 submitting patches through email. For information on how to do both as
 well as information on how to identify the maintainer for each area of
-code, see the :doc:`../contributor-guide/index`.
+code, see the :doc:`/contributor-guide/index`.
 
 .. _resources-bugtracker:
 
@@ -45,7 +45,7 @@ your expectations).
 For a general procedure and guidelines on how to use Bugzilla to submit a bug
 against the Yocto Project, see the following:
 
--  The ":doc:`../contributor-guide/report-defect`"
+-  The ":doc:`/contributor-guide/report-defect`"
    section in the Yocto Project and OpenEmbedded Contributor Guide.
 
 -  The Yocto Project :yocto_wiki:`Bugzilla wiki page </Bugzilla_Configuration_and_Bug_Tracking>`
documentation/ref-manual/system-requirements.rst +1 -1
index b64a13320a148d494dac2df3f82cd7c70dae5e05..14b635013bc64ce6d53ab0334fd0a2718764a0d7 100644
@@ -145,7 +145,7 @@ tested on former revisions of "&DISTRO_NAME;", but no longer are:
       interested in hearing about your experience. For information on
       how to submit a bug, see the Yocto Project
       :yocto_wiki:`Bugzilla wiki page </Bugzilla_Configuration_and_Bug_Tracking>`
-      and the ":doc:`../contributor-guide/report-defect`"
+      and the ":doc:`/contributor-guide/report-defect`"
       section in the Yocto Project and OpenEmbedded Contributor Guide.
 
 Required Packages for the Build Host
documentation/ref-manual/variables.rst +1 -1
index 5c18b852d19e8e181eac4b33f10e43279b3068c2..5ed594c776db9cd993ae85f5187fa53b071087d2 100644
@@ -2576,7 +2576,7 @@ system and gives an overview of their function and contents.
       You can safely share this directory between multiple builds on the
       same development machine. For additional information on how the build
       process gets source files when working behind a firewall or proxy
-      server, see this specific question in the ":doc:`faq`"
+      server, see this specific question in the ":doc:`/ref-manual/faq`"
       chapter. You can also refer to the
       ":yocto_wiki:`Working Behind a Network Proxy </Working_Behind_a_Network_Proxy>`"
       Wiki page.
documentation/transitioning-to-a-custom-environment.rst +2 -2
index 6ff55e56191b49a22ccfe346371735df9f7819fe..a5f55c567acffbe46a3096c31c0d02be798048d7 100644
@@ -8,8 +8,8 @@ Transitioning to a custom environment for systems development
 
 .. note::
 
-   So you've finished the :doc:`brief-yoctoprojectqs/index` and
-   glanced over the document :doc:`what-i-wish-id-known`, the latter contains
+   So you've finished the :doc:`/brief-yoctoprojectqs/index` and
+   glanced over the document :doc:`/what-i-wish-id-known`, the latter contains
    important information learned from other users. You're well prepared. But
    now, as you are starting your own project, it isn't exactly straightforward what
    to do. And, the documentation is daunting. We've put together a few hints to
documentation/what-i-wish-id-known.rst +2 -2
index 836097910d29439249ebfaba49af75b8d6d4948c..ddee6ad7498a0173f79b50c16869f8cae001a92c 100644
@@ -49,7 +49,7 @@ contact us with other suggestions.
    their silicon. These layers have names such as "meta-intel" or "meta-ti". Try
    not to build layers from scratch. If you do have custom silicon, use one of
    these layers as a guide or template and familiarize yourself with the
-   :doc:`bsp-guide/index`.
+   :doc:`/bsp-guide/index`.
 
 #. **Do not put everything into one layer:**
    Use different layers to logically separate information in your build. As an
@@ -127,7 +127,7 @@ contact us with other suggestions.
    You can build and run a specific task for a specific package (including
    devshell) or even a single recipe. When developers first start using the
    Yocto Project, the instructions found in the
-   :doc:`brief-yoctoprojectqs/index` show how to create an image
+   :doc:`/brief-yoctoprojectqs/index` show how to create an image
    and then run or flash that image.  However, you can actually build just a
    single recipe. Thus, if some dependency or recipe isn't working, you can just
    say "bitbake foo" where "foo" is the name for a specific recipe.  As you
Signature · 1 line
2.49.0
#2 lore raw

PATCH 2/2 document how to use :doc: directive

In reply to Quentin Schulz

From: Quentin Schulz <[email protected]>

Let's specify that we are only expecting "absolute" paths in the docs directive for local document referencing.

---
 documentation/README       | 10 ++++++++++
 documentation/standards.md | 11 ++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
documentation/README +10 -0
index 02037e0f7ecf5c7ea18688e8ffbcfbd60c859f1c..56eac7ca1953a3b001daaba18ac7f63305c94b68 100644
@@ -314,6 +314,16 @@ See https://stackoverflow.com/questions/27420317/restructured-text-rst-http-link
 Anchor (<#link>) links are forbidden as they are not checked by Sphinx during
 the build and may be broken without knowing about it.
 
+It is also possible to refer to another document within yocto-docs with the
+:doc: directive (c.f.
+https://www.sphinx-doc.org/en/master/usage/referencing.html#role-doc), e.g.:
+
+  For more information, read :doc:`/bsp-guide/index`.
+
+Note that only "absolute" paths (starting with a '/') are allowed. The root
+directory of that path is documentation/, that is, :doc:`/bsp-guide/index`
+points at documentation/bsp-guide/index.rst.
+
 References
 ==========
 
documentation/standards.md +10 -1
index 8300d813dccba87a4d235a43b2ea7a414042e9bc..801efe3457aa9c8e7175ab15c25abbf0789df8e0 100644
@@ -126,7 +126,16 @@ that most themes only style these two admonitions.
 
 ## ReStructured Text Syntax standards
 
-This section has not been filled yet
+### doc directive
+
+The [doc directive](https://www.sphinx-doc.org/en/master/usage/referencing.html#role-doc)
+allows to refer to another document within yocto-docs, like:
+
+    For more information, read :doc:`/bsp-guide/index`.
+
+Note that only "absolute" paths (starting with a '/') are allowed. The root
+directory of that path is documentation/, that is, :doc:`/bsp-guide/index`
+points at documentation/bsp-guide/index.rst.
 
 ## Adding screenshots
 
Signature · 1 line
2.49.0
#3 lore raw
In reply to Quentin Schulz
Quoted 8 lines · Quentin Schulz

The doc directive[1] allows multiple paths:
- relative to the current document
- relative to the current document going through the parent directory (e.g. via ../)
- "absolute" (paths starting with /), relative to the root directory (which is documentation/ for yocto-docs),

[...]

Applied, thanks!

[1/2] tree-wide: make the :doc: directive use absolute paths

      commit: b9457f2005b0bea49c54e9727eb30e9458084886
[2/2] document how to use :doc: directive
      commit: 2729250bf1068814e5106d1e71796e8a505963d7

Best regards,

Signature · 1 line
Antonin Godard <[email protected]>