diff options
| author | Michael Opdenacker <michael.opdenacker@bootlin.com> | 2024-03-12 21:58:39 +0100 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-04-05 07:23:59 -0700 |
| commit | 15034b32a5c81b963f1eb49b9bbaeb629b8a1f1e (patch) | |
| tree | feaeeeee7ce2d67c2e8f0b09d2902d53991d2c77 /documentation | |
| parent | 85da9544659268b727bd13f55a9f13d97f5234c9 (diff) | |
| download | poky-15034b32a5c81b963f1eb49b9bbaeb629b8a1f1e.tar.gz | |
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: e3e4ba2aa963d4d178c4e9e842e66f4ee4bd3736)
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'documentation')
| -rw-r--r-- | documentation/.gitignore | 2 | ||||
| -rw-r--r-- | documentation/.vale.ini | 7 | ||||
| -rw-r--r-- | documentation/Makefile | 13 | ||||
| -rw-r--r-- | documentation/README | 14 | ||||
| -rw-r--r-- | documentation/standards.md | 15 | ||||
| -rw-r--r-- | documentation/styles/config/vocabularies/OpenSource/accept.txt | 4 | ||||
| -rw-r--r-- | documentation/styles/config/vocabularies/Yocto/accept.txt | 4 |
7 files changed, 58 insertions, 1 deletions
diff --git a/documentation/.gitignore b/documentation/.gitignore index 096b97ec28..a8f86f7c98 100644 --- a/documentation/.gitignore +++ b/documentation/.gitignore | |||
| @@ -5,3 +5,5 @@ sphinx-static/switchers.js | |||
| 5 | .vscode/ | 5 | .vscode/ |
| 6 | */svg/*.png | 6 | */svg/*.png |
| 7 | */svg/*.pdf | 7 | */svg/*.pdf |
| 8 | styles/* | ||
| 9 | !styles/config | ||
diff --git a/documentation/.vale.ini b/documentation/.vale.ini new file mode 100644 index 0000000000..02042bb632 --- /dev/null +++ b/documentation/.vale.ini | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | StylesPath = styles | ||
| 2 | MinAlertLevel = suggestion | ||
| 3 | Packages = RedHat, proselint, write-good, alex, Readability, Joblint | ||
| 4 | Vocab = Yocto, OpenSource | ||
| 5 | [*.rst] | ||
| 6 | BasedOnStyles = Vale, RedHat, proselint, write-good, alex, Readability, Joblint | ||
| 7 | |||
diff --git a/documentation/Makefile b/documentation/Makefile index 33bbca0bab..e5f0effeb5 100644 --- a/documentation/Makefile +++ b/documentation/Makefile | |||
| @@ -5,6 +5,9 @@ | |||
| 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 | ||
| 9 | VALEOPTS ?= --no-wrap --glob '!migration-guides/release-notes-*.rst' | ||
| 10 | VALEDOCS ?= . | ||
| 8 | SOURCEDIR = . | 11 | SOURCEDIR = . |
| 9 | IMAGEDIRS = */svg | 12 | IMAGEDIRS = */svg |
| 10 | BUILDDIR = _build | 13 | BUILDDIR = _build |
| @@ -20,7 +23,7 @@ endif | |||
| 20 | help: | 23 | help: |
| 21 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | 24 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
| 22 | 25 | ||
| 23 | .PHONY: all help Makefile clean publish epub latexpdf | 26 | .PHONY: all help Makefile clean stylecheck publish epub latexpdf |
| 24 | 27 | ||
| 25 | publish: Makefile html singlehtml | 28 | publish: Makefile html singlehtml |
| 26 | rm -rf $(BUILDDIR)/$(DESTDIR)/ | 29 | rm -rf $(BUILDDIR)/$(DESTDIR)/ |
| @@ -46,6 +49,14 @@ PNGs := $(foreach dir, $(IMAGEDIRS), $(patsubst %.svg,%.png,$(wildcard $(SOURCED | |||
| 46 | clean: | 49 | clean: |
| 47 | @rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js | 50 | @rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js |
| 48 | 51 | ||
| 52 | stylecheck: | ||
| 53 | vale sync | ||
| 54 | vale $(VALEOPTS) $(VALEDOCS) | ||
| 55 | |||
| 56 | stylecheck: | ||
| 57 | vale sync | ||
| 58 | vale $(VALEOPTS) $(VALEDOCS) | ||
| 59 | |||
| 49 | epub: $(PNGs) | 60 | epub: $(PNGs) |
| 50 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | 61 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
| 51 | 62 | ||
diff --git a/documentation/README b/documentation/README index 4d31036e69..8035418cac 100644 --- a/documentation/README +++ b/documentation/README | |||
| @@ -151,6 +151,20 @@ dependencies in a virtual environment: | |||
| 151 | $ pipenv install | 151 | $ pipenv install |
| 152 | $ pipenv run make html | 152 | $ pipenv run make html |
| 153 | 153 | ||
| 154 | Style checking the Yocto Project documentation | ||
| 155 | ============================================== | ||
| 156 | |||
| 157 | The project is starting to use Vale (https://vale.sh/) | ||
| 158 | to validate the text style. | ||
| 159 | |||
| 160 | To install Vale: | ||
| 161 | |||
| 162 | $ pip install vale | ||
| 163 | |||
| 164 | To run Vale: | ||
| 165 | |||
| 166 | $ make stylecheck | ||
| 167 | |||
| 154 | Sphinx theme and CSS customization | 168 | Sphinx theme and CSS customization |
| 155 | ================================== | 169 | ================================== |
| 156 | 170 | ||
diff --git a/documentation/standards.md b/documentation/standards.md index a2274f6d6e..d3b25adfab 100644 --- a/documentation/standards.md +++ b/documentation/standards.md | |||
| @@ -5,6 +5,21 @@ documentation is created. | |||
| 5 | 5 | ||
| 6 | It is currently a work in progress. | 6 | It is currently a work in progress. |
| 7 | 7 | ||
| 8 | ## Automatic style validation | ||
| 9 | |||
| 10 | There is an ongoing effort to automate style validation | ||
| 11 | through the [Vale](https://vale.sh/). To try it, run: | ||
| 12 | |||
| 13 | $ make stylecheck | ||
| 14 | |||
| 15 | Note that this just applies to text. Therefore, the syntax | ||
| 16 | conventions described below still apply. | ||
| 17 | |||
| 18 | If you wish to add a new word to an "accept.txt" file | ||
| 19 | (./styles/config/vocabularies/<Vocab>/accept.txt), | ||
| 20 | make sure the spelling and capitalization matches | ||
| 21 | what Wikipedia or the project defining this word uses. | ||
| 22 | |||
| 8 | ## Text standards | 23 | ## Text standards |
| 9 | 24 | ||
| 10 | This section has not been filled yet | 25 | This section has not been filled yet |
diff --git a/documentation/styles/config/vocabularies/OpenSource/accept.txt b/documentation/styles/config/vocabularies/OpenSource/accept.txt new file mode 100644 index 0000000000..98e76ae1f5 --- /dev/null +++ b/documentation/styles/config/vocabularies/OpenSource/accept.txt | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | ftrace | ||
| 2 | toolchain | ||
| 3 | systemd | ||
| 4 | LTTng | ||
diff --git a/documentation/styles/config/vocabularies/Yocto/accept.txt b/documentation/styles/config/vocabularies/Yocto/accept.txt new file mode 100644 index 0000000000..b725414014 --- /dev/null +++ b/documentation/styles/config/vocabularies/Yocto/accept.txt | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | Yocto | ||
| 2 | BSP | ||
| 3 | BitBake | ||
| 4 | OpenEmbedded | ||
