diff mbox series

manuals: add initial sphinx-lint support

Message ID 20240330163609.1735506-1-michael.opdenacker@bootlin.com
State New
Headers show
Series manuals: add initial sphinx-lint support | expand

Commit Message

Michael Opdenacker March 30, 2024, 4:36 p.m. UTC
From: Michael Opdenacker <michael.opdenacker@bootlin.com>

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".

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
---
 documentation/Makefile |  3 +++
 documentation/README   | 14 ++++++++++++++
 2 files changed, 17 insertions(+)

Comments

Jörg Sommer April 2, 2024, 7:53 a.m. UTC | #1
Michael Opdenacker via lists.yoctoproject.org schrieb am Sa 30. Mär, 17:36 (+0100):
> 
> Just run "make sphinx-lint".

> +sphinx-lint:
> +	sphinx-lint

> +To run sphinx-lint:
> +
> + $ make sphinxlint

Is a dash missing in this command?


Regards Jörg

--
Michael Opdenacker April 2, 2024, 9:23 a.m. UTC | #2
Hi Jörg

On 4/2/24 at 09:53, Jörg Sommer wrote:
> Michael Opdenacker via lists.yoctoproject.org schrieb am Sa 30. Mär, 17:36 (+0100):
>> Just run "make sphinx-lint".
>> +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.
Quentin Schulz April 2, 2024, 9:59 a.m. UTC | #3
Hi Michael,

On 3/30/24 17:36, Michael Opdenacker via lists.yoctoproject.org wrote:
> From: Michael Opdenacker <michael.opdenacker@bootlin.com>
> 
> 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".
> 
> Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
> ---
>   documentation/Makefile |  3 +++
>   documentation/README   | 14 ++++++++++++++
>   2 files changed, 17 insertions(+)
> 
> diff --git a/documentation/Makefile b/documentation/Makefile
> index f3b775b3ec..cacb51c036 100644
> --- a/documentation/Makefile
> +++ b/documentation/Makefile
> @@ -53,6 +53,9 @@ stylecheck:
>   	vale sync
>   	vale $(VALEOPTS) $(VALEDOCS)
>   
> +sphinx-lint:
> +	sphinx-lint
> +

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

Cheers,
Quentin
Michael Opdenacker April 2, 2024, 1:22 p.m. UTC | #4
Hi Quentin

On 4/2/24 at 11:59, Quentin Schulz wrote:
> Hi Michael,
>
> On 3/30/24 17:36, Michael Opdenacker via lists.yoctoproject.org wrote:
>> From: Michael Opdenacker <michael.opdenacker@bootlin.com>
>>
>> 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".
>>
>> Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
>> ---
>>   documentation/Makefile |  3 +++
>>   documentation/README   | 14 ++++++++++++++
>>   2 files changed, 17 insertions(+)
>>
>> diff --git a/documentation/Makefile b/documentation/Makefile
>> index f3b775b3ec..cacb51c036 100644
>> --- a/documentation/Makefile
>> +++ b/documentation/Makefile
>> @@ -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.
diff mbox series

Patch

diff --git a/documentation/Makefile b/documentation/Makefile
index f3b775b3ec..cacb51c036 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -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)
diff --git a/documentation/README b/documentation/README
index 8035418cac..e1451789b6 100644
--- a/documentation/README
+++ b/documentation/README
@@ -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
 ==================================