diff options
author | Julien Stephan <jstephan@baylibre.com> | 2024-11-04 16:59:13 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-11-09 05:53:57 -0800 |
commit | f6ac0554af76899036fe89ae8df9c90901e694b9 (patch) | |
tree | 8db0aa960be4786aa5e4c37045b13f171ac7fc6c /documentation | |
parent | 5c781e69d70032d9cef8bc95725dfa27405073ec (diff) | |
download | poky-f6ac0554af76899036fe89ae8df9c90901e694b9.tar.gz |
documentation: Makefile: add SPHINXLINTDOCS to specify subset to sphinx-lint
make sphinx-lint runs sphinx-lint on the whole documentation which can be
long and reports a lot or errors/warnings. Let's add a new
SHPINXLINTDOCS variable to allow specifying a subset, just as VALEDOCS
does. Keep variable assignment aligned and also use $(SOURCEDIR) by
default for SPHINXLINTDOCS and VALEDOCS variables.
Also update the README file and fix a typo in Link checking section
title.
(From yocto-docs rev: c478ef829433c431456835bca240df44ffe8fcca)
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: Antonin Godard <antonin.godard@bootlin.com>
Tested-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
(cherry picked from commit 3dfe7b5c746af31de74f67cf88214e5d52bdb65d)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/Makefile | 23 | ||||
-rw-r--r-- | documentation/README | 10 |
2 files changed, 21 insertions, 12 deletions
diff --git a/documentation/Makefile b/documentation/Makefile index 189bd1dfac..0bd9db5eae 100644 --- a/documentation/Makefile +++ b/documentation/Makefile | |||
@@ -3,17 +3,18 @@ | |||
3 | 3 | ||
4 | # You can set these variables from the command line, and also | 4 | # You can set these variables from the command line, and also |
5 | # from the environment for the first two. | 5 | # from the environment for the first two. |
6 | SPHINXOPTS ?= -W --keep-going -j auto | 6 | SPHINXOPTS ?= -W --keep-going -j auto |
7 | SPHINXBUILD ?= sphinx-build | 7 | SPHINXBUILD ?= sphinx-build |
8 | # Release notes are excluded because they contain contributor names and commit messages which can't be modified | 8 | # Release notes are excluded because they contain contributor names and commit messages which can't be modified |
9 | VALEOPTS ?= --no-wrap --glob '!migration-guides/release-notes-*.rst' | 9 | VALEOPTS ?= --no-wrap --glob '!migration-guides/release-notes-*.rst' |
10 | VALEDOCS ?= . | 10 | SOURCEDIR = . |
11 | SOURCEDIR = . | 11 | VALEDOCS ?= $(SOURCEDIR) |
12 | IMAGEDIRS = */svg | 12 | SPHINXLINTDOCS ?= $(SOURCEDIR) |
13 | BUILDDIR = _build | 13 | IMAGEDIRS = */svg |
14 | DESTDIR = final | 14 | BUILDDIR = _build |
15 | SVG2PNG = inkscape | 15 | DESTDIR = final |
16 | SVG2PDF = inkscape | 16 | SVG2PNG = inkscape |
17 | SVG2PDF = inkscape | ||
17 | 18 | ||
18 | ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0) | 19 | ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0) |
19 | $(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed") | 20 | $(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed") |
@@ -54,7 +55,7 @@ stylecheck: | |||
54 | vale $(VALEOPTS) $(VALEDOCS) | 55 | vale $(VALEOPTS) $(VALEDOCS) |
55 | 56 | ||
56 | sphinx-lint: | 57 | sphinx-lint: |
57 | sphinx-lint $(SOURCEDIR) | 58 | sphinx-lint $(SPHINXLINTDOCS) |
58 | 59 | ||
59 | epub: $(PNGs) | 60 | epub: $(PNGs) |
60 | $(SOURCEDIR)/set_versions.py | 61 | $(SOURCEDIR)/set_versions.py |
diff --git a/documentation/README b/documentation/README index a7138c40e2..d7428eb8ed 100644 --- a/documentation/README +++ b/documentation/README | |||
@@ -173,7 +173,7 @@ directories: | |||
173 | $ make stylecheck VALEDOCS="<file1> <file2>" | 173 | $ make stylecheck VALEDOCS="<file1> <file2>" |
174 | $ make stylecheck VALEDOCS=<dir> | 174 | $ make stylecheck VALEDOCS=<dir> |
175 | 175 | ||
176 | Link checking the Yocto Project documentation | 176 | Lint checking the Yocto Project documentation |
177 | ============================================= | 177 | ============================================= |
178 | 178 | ||
179 | To fix errors which are not reported by Sphinx itself, | 179 | To fix errors which are not reported by Sphinx itself, |
@@ -187,6 +187,14 @@ To run sphinx-lint: | |||
187 | 187 | ||
188 | $ make sphinx-lint | 188 | $ make sphinx-lint |
189 | 189 | ||
190 | Lint checking the whole documentation might take some time and generate a | ||
191 | lot of warnings/errors, thus one can run sphinx-lint on a subset of files | ||
192 | or directories: | ||
193 | |||
194 | $ make sphinx-lint SPHINXLINTDOCS=<file> | ||
195 | $ make sphinx-lint SPHINXLINTDOCS="<file1> <file2>" | ||
196 | $ make sphinx-lint SPHINXLINTDOCS=<dir> | ||
197 | |||
190 | Sphinx theme and CSS customization | 198 | Sphinx theme and CSS customization |
191 | ================================== | 199 | ================================== |
192 | 200 | ||