From: Antonin Godard <antonin.godard@bootlin.com>
To: docs@lists.yoctoproject.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Antonin Godard <antonin.godard@bootlin.com>
Subject: [PATCH v2 1/3] conf.py: add linkcheck builder exclusions for frequent links
Date: Tue, 21 Jul 2026 14:17:53 +0200 [thread overview]
Message-ID: <20260721-linkcheck-v2-1-32d93e054c50@bootlin.com> (raw)
In-Reply-To: <20260721-linkcheck-v2-0-32d93e054c50@bootlin.com>
The linkcheck builder can be used to scout for broken links. By looking at
the output of:
grep -E -r --no-filename -o 'href="http.://[^/"]+' | sort | uniq -c | sort -nr
from the HTML output directory, exclude links that are too frequent.
Remove docs.yoctoproject.org links are those should already be
validated when building the documentation, and add a LINKCHECK_NOT_NICE
env variable that can be set to check for those links anyway.
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
documentation/README | 14 ++++++++++++++
documentation/conf.py | 17 +++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/documentation/README b/documentation/README
index 326930932..39835f014 100644
--- a/documentation/README
+++ b/documentation/README
@@ -163,6 +163,20 @@ or directories:
$ make sphinx-lint SPHINXLINTDOCS="<file1> <file2>"
$ make sphinx-lint SPHINXLINTDOCS=<dir>
+Checking for broken links in the Yocto Project documentation
+============================================================
+
+To scout for broken links, the "linkcheck" builder from Sphinx can be used with
+the following command:
+
+ $ make linkcheck
+
+The builder is already configured in conf.py to exclude the links that are too
+frequent in the documentation. You can enable linkcheck for these links by
+setting the LINKCHECK_NOT_NICE environment variable to "1":
+
+ $ LINKCHECK_NOT_NICE=1 make linkcheck
+
Sphinx theme and CSS customization
==================================
diff --git a/documentation/conf.py b/documentation/conf.py
index 7b201ebd6..8b50656bf 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -143,6 +143,23 @@ suppress_warnings = ['epub.unknown_project_files']
# sphinx-copybutton configuration
copybutton_prompt_text = "$ "
+# Don't check self-references to yocto-docs since they are already
+# checked when building.
+linkcheck_ignore = [r'https?://docs\.yoctoproject\.org.*']
+
+# When using the linkcheck builder, ignore the following links which are too
+# frequent in the docs, unless the LINKCHECK_NOT_NICE environment variable is set
+# to 1.
+if os.environ.get('LINKCHECK_NOT_NICE') != "1":
+ linkcheck_ignore.extend([
+ r'https?://nvd\.nist\.gov.*',
+ r'https?://git\.yoctoproject\.org.*',
+ r'https?://git\.openembedded\.org.*',
+ r'https?://downloads\.yoctoproject\.org.*',
+ r'https?://mirrors\.kernel\.org.*',
+ r'https?://mirrors\.edge\.kernel\.org.*',
+ ])
+
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
--
2.55.0
next prev parent reply other threads:[~2026-07-21 12:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 12:17 [PATCH v2 0/3] Fix broken links Antonin Godard
2026-07-21 12:17 ` Antonin Godard [this message]
2026-07-21 12:17 ` [PATCH v2 2/3] migration-guides/migration-3.4.rst: replace rlbl broken link Antonin Godard
2026-07-21 12:17 ` [PATCH v2 3/3] migration-guides: replace broken link with archive links Antonin Godard
2026-07-31 9:36 ` [PATCH v2 0/3] Fix broken links Antonin Godard
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=20260721-linkcheck-v2-1-32d93e054c50@bootlin.com \
--to=antonin.godard@bootlin.com \
--cc=docs@lists.yoctoproject.org \
--cc=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox