mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
manuals: add initial stylechecks with Vale
Use the "Vale" (https://vale.sh) tool to perform text style checks Run "make stylecheck" to run the checks. This just checks the text, not the Sphinx syntax style choices. (From yocto-docs rev: d145e1dc45dc0792c8b8f7e73500b56face1e710) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
0808113517
commit
e987c5151c
2
documentation/.gitignore
vendored
2
documentation/.gitignore
vendored
@@ -7,3 +7,5 @@ releases.rst
|
|||||||
.vscode/
|
.vscode/
|
||||||
*/svg/*.png
|
*/svg/*.png
|
||||||
*/svg/*.pdf
|
*/svg/*.pdf
|
||||||
|
styles/*
|
||||||
|
!styles/config
|
||||||
|
|||||||
7
documentation/.vale.ini
Normal file
7
documentation/.vale.ini
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
StylesPath = styles
|
||||||
|
MinAlertLevel = suggestion
|
||||||
|
Packages = RedHat, proselint, write-good, alex, Readability, Joblint
|
||||||
|
Vocab = Yocto, OpenSource
|
||||||
|
[*.rst]
|
||||||
|
BasedOnStyles = Vale, RedHat, proselint, write-good, alex, Readability, Joblint
|
||||||
|
|
||||||
@@ -5,6 +5,9 @@
|
|||||||
# from the environment for the first two.
|
# from the environment for the first two.
|
||||||
SPHINXOPTS ?= -W --keep-going -j auto
|
SPHINXOPTS ?= -W --keep-going -j auto
|
||||||
SPHINXBUILD ?= sphinx-build
|
SPHINXBUILD ?= sphinx-build
|
||||||
|
# Release notes are excluded because they contain contributor names and commit messages which can't be modified
|
||||||
|
VALEOPTS ?= --no-wrap --glob '!migration-guides/release-notes-*.rst'
|
||||||
|
VALEDOCS ?= .
|
||||||
SOURCEDIR = .
|
SOURCEDIR = .
|
||||||
IMAGEDIRS = */svg
|
IMAGEDIRS = */svg
|
||||||
BUILDDIR = _build
|
BUILDDIR = _build
|
||||||
@@ -20,7 +23,7 @@ endif
|
|||||||
help:
|
help:
|
||||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
|
|
||||||
.PHONY: all help Makefile clean publish epub latexpdf
|
.PHONY: all help Makefile clean stylecheck publish epub latexpdf
|
||||||
|
|
||||||
publish: Makefile html singlehtml
|
publish: Makefile html singlehtml
|
||||||
rm -rf $(BUILDDIR)/$(DESTDIR)/
|
rm -rf $(BUILDDIR)/$(DESTDIR)/
|
||||||
@@ -46,6 +49,10 @@ PNGs := $(foreach dir, $(IMAGEDIRS), $(patsubst %.svg,%.png,$(wildcard $(SOURCED
|
|||||||
clean:
|
clean:
|
||||||
@rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js
|
@rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js
|
||||||
|
|
||||||
|
stylecheck:
|
||||||
|
vale sync
|
||||||
|
vale $(VALEOPTS) $(VALEDOCS)
|
||||||
|
|
||||||
epub: $(PNGs)
|
epub: $(PNGs)
|
||||||
$(SOURCEDIR)/set_versions.py
|
$(SOURCEDIR)/set_versions.py
|
||||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
|
|||||||
@@ -151,6 +151,20 @@ dependencies in a virtual environment:
|
|||||||
$ pipenv install
|
$ pipenv install
|
||||||
$ pipenv run make html
|
$ pipenv run make html
|
||||||
|
|
||||||
|
Style checking the Yocto Project documentation
|
||||||
|
==============================================
|
||||||
|
|
||||||
|
The project is starting to use Vale (https://vale.sh/)
|
||||||
|
to validate the text style.
|
||||||
|
|
||||||
|
To install Vale:
|
||||||
|
|
||||||
|
$ pip install vale
|
||||||
|
|
||||||
|
To run Vale:
|
||||||
|
|
||||||
|
$ make stylecheck
|
||||||
|
|
||||||
Sphinx theme and CSS customization
|
Sphinx theme and CSS customization
|
||||||
==================================
|
==================================
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,21 @@ documentation is created.
|
|||||||
|
|
||||||
It is currently a work in progress.
|
It is currently a work in progress.
|
||||||
|
|
||||||
|
## Automatic style validation
|
||||||
|
|
||||||
|
There is an ongoing effort to automate style validation
|
||||||
|
through the [Vale](https://vale.sh/). To try it, run:
|
||||||
|
|
||||||
|
$ make stylecheck
|
||||||
|
|
||||||
|
Note that this just applies to text. Therefore, the syntax
|
||||||
|
conventions described below still apply.
|
||||||
|
|
||||||
|
If you wish to add a new word to an "accept.txt" file
|
||||||
|
(./styles/config/vocabularies/<Vocab>/accept.txt),
|
||||||
|
make sure the spelling and capitalization matches
|
||||||
|
what Wikipedia or the project defining this word uses.
|
||||||
|
|
||||||
## Text standards
|
## Text standards
|
||||||
|
|
||||||
### Bulleted lists
|
### Bulleted lists
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
ftrace
|
||||||
|
toolchain
|
||||||
|
systemd
|
||||||
|
LTTng
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Yocto
|
||||||
|
BSP
|
||||||
|
BitBake
|
||||||
|
OpenEmbedded
|
||||||
Reference in New Issue
Block a user