Skip to contentSkip to conversation

manuals: add initial sphinx-lint support

PATCH In review [email protected] 3 participants 5 messages Mar 30, 2024 – Apr 2, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 manuals: add initial sphinx-lint support

From: Michael Opdenacker <[email protected]>

Makes it possible to catch errors not reported by sphinx, such as idle spaces. After customization, this should be used to enforce our syntax conventions, such as two spaces after a "-" character to introduce a list item.

Just run "make sphinx-lint".

---
 documentation/Makefile |  3 +++
 documentation/README   | 14 ++++++++++++++
 2 files changed, 17 insertions(+)
documentation/Makefile +3 -0
index f3b775b3ec..cacb51c036 100644
@@ -53,6 +53,9 @@ stylecheck:
 	vale sync
 	vale $(VALEOPTS) $(VALEDOCS)
 
+sphinx-lint:
+	sphinx-lint
+
 epub: $(PNGs)
 	$(SOURCEDIR)/set_versions.py
 	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
documentation/README +14 -0
index 8035418cac..e1451789b6 100644
@@ -165,6 +165,20 @@ To run Vale:
 
  $ make stylecheck
 
+Link checking the Yocto Project documentation
+=============================================
+
+To fix errors which are not reported by Sphinx itself,
+the project uses sphinx-lint (https://github.com/sphinx-contrib/sphinx-lint).
+
+To install sphinx-lint:
+
+ $ pip install sphinx-lint
+
+To run sphinx-lint:
+
+ $ make sphinxlint
+
 Sphinx theme and CSS customization
 ==================================
 
Signature · 1 line
2.34.1
#1 lore raw

Michael Opdenacker via lists.yoctoproject.org schrieb am Sa 30. Mär, 17:36 (+0100):

documentation/README To run Vale: · line 180

Quoted 9 lines

Just run "make sphinx-lint".

documentation/README +5 -0
+sphinx-lint:
+	sphinx-lint
 
+To run sphinx-lint:
+
+ $ make sphinxlint

Is a dash missing in this command?

Regards Jörg

#2 lore raw

Hi Jörg

Quoted 8 lines · Jörg Sommer

Michael Opdenacker via lists.yoctoproject.org schrieb am Sa 30. Mär, 17:36 (+0100):

documentation/Makefile stylecheck:

Quoted 6 lines

Just run "make sphinx-lint".

documentation/Makefile +5 -0
+sphinx-lint:
+	sphinx-lint
+To run sphinx-lint:
+
+ $ make sphinxlint

Is a dash missing in this command?

Oops, good catch. It was a leftover from my first version. Fixed.
Thanks!
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw
In reply to [email protected]

Hi Michael,

Quoted 20 lines · Michael Opdenacker via lists.yoctoproject.org

From: Michael Opdenacker <[email protected]>

Makes it possible to catch errors not reported by sphinx, such as idle spaces. After customization, this should be used to enforce our syntax conventions, such as two spaces after a "-" character to introduce a list item.

Just run "make sphinx-lint".

---
  documentation/Makefile |  3 +++
  documentation/README   | 14 ++++++++++++++
  2 files changed, 17 insertions(+)
documentation/Makefile +0 -0
index f3b775b3ec..cacb51c036 100644

documentation/Makefile stylecheck: · line 58

Quoted 6 lines
documentation/Makefile +3 -0
@@ -53,6 +53,9 @@ stylecheck:
  	vale sync
  	vale $(VALEOPTS) $(VALEDOCS)
 
+sphinx-lint:
+	sphinx-lint
+

I would pass $(SOURCEDIR) as argument as well.

Cheers,
Quentin

#4 lore raw

Hi Quentin

Quoted 18 lines · Quentin Schulz

Hi Michael,

Quoted 15 lines · Michael Opdenacker via lists.yoctoproject.org

From: Michael Opdenacker <[email protected]>

Makes it possible to catch errors not reported by sphinx, such as idle spaces. After customization, this should be used to enforce our syntax conventions, such as two spaces after a "-" character to introduce a list item.

Just run "make sphinx-lint".

---
  documentation/Makefile |  3 +++
  documentation/README   | 14 ++++++++++++++

  2 files changed, 17 insertions(+)
Quoted 12 lines
Quoted 10 lines
documentation/Makefile +0 -0
index f3b775b3ec..cacb51c036 100644
@@ -53,6 +53,9 @@ stylecheck:

      vale sync
      vale $(VALEOPTS) $(VALEDOCS)
  +sphinx-lint:
+    sphinx-lint
+

I would pass $(SOURCEDIR) as argument as well.

Good idea!
I modified my branch.
Thanks
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com