Skip to content

Commit 8ac10f8

Browse files
authored
Merge branch '6-dev' into version-switcher
2 parents b32f04d + c75989e commit 8ac10f8

File tree

27 files changed

+121
-91
lines changed

27 files changed

+121
-91
lines changed

.github/workflows/build_deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
pip install -q -r requirements.txt
2323
pip freeze
2424
25-
# - name: Run spellcheck
26-
# run: make spellcheck
25+
# - name: Run Vale
26+
# run: make vale
2727

2828
# - name: Run linkcheck
2929
# run: make linkcheck

.github/workflows/test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ jobs:
2020
run: |
2121
python -m pip install --upgrade pip
2222
pip install -q -r requirements.txt
23+
sudo snap install --edge vale
2324
2425
- name: Run tests with make test
2526
run: make test
27+
28+
- name: Run vale
29+
run: |
30+
git clone https://github.com/errata-ai/Microsoft.git
31+
cp -r ./Microsoft/Microsoft ./styles
32+
VALEFILES=$(find -L ./docs/ -type d \( -path "./docs/plone.restapi/lib/*" -o -path "./docs/plone.restapi/performance/*" \) -prune -false -o -type f -name "*.md" -print)
33+
vale --no-exit $VALEFILES

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Generated files
88
pyvenv.cfg
99
/_build
10+
/styles/Microsoft
1011

1112
# symlinked from submodule
1213
docs/volto

.vale.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
StylesPath = styles
2+
3+
MinAlertLevel = suggestion
4+
5+
Vocab = Base,Plone
6+
7+
Packages = Microsoft
8+
9+
[*]
10+
BasedOnStyles = Vale, Microsoft

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PAPEROPT_letter = -D latex_paper_size=letter
1616
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1717
# the i18n builder cannot share the environment and doctrees with the others
1818
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19-
19+
VALEFILES := $(shell find -L $(DOCS_DIR) -type d \( -path $(DOCS_DIR)/plone.restapi/lib/* -o -path $(DOCS_DIR)"/plone.restapi/performance/*" \) -prune -false -o -type f -name "*.md" -print)
2020

2121
# Add the following 'help' target to your Makefile
2222
# And add help text after each target name starting with '\#\#'
@@ -189,17 +189,17 @@ linkcheck: deps ## Run linkcheck
189189

190190
.PHONY: linkcheckbroken
191191
linkcheckbroken: deps ## Run linkcheck and show only broken links
192-
cd $(DOCS_DIR) && $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | GREP_COLORS='0;31' grep -wi "broken\|redirect" --color=auto || test $$? = 1
192+
cd $(DOCS_DIR) && $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | grep -wi "broken\|redirect" | GREP_COLORS='0;31' grep -vi "https://github.com/plone/volto/issues/" --color=auto || test $$? = 1
193193
@echo
194194
@echo "Link check complete; look for any errors in the above output " \
195195
"or in $(BUILDDIR)/linkcheck/ ."
196196

197-
.PHONY: spellcheck
198-
spellcheck: deps ## Run spellcheck
199-
cd $(DOCS_DIR) && LANGUAGE=$* $(SPHINXBUILD) -b spelling -j 4 $(ALLSPHINXOPTS) $(BUILDDIR)/spellcheck/$*
197+
.PHONY: vale
198+
vale: deps ## Run Vale style, grammar, and spell checks
199+
vale sync
200+
vale --no-wrap $(VALEFILES)
200201
@echo
201-
@echo "Spellcheck is finished; look for any errors in the above output " \
202-
" or in $(BUILDDIR)/spellcheck/ ."
202+
@echo "Vale is finished; look for any errors in the above output."
203203

204204
.PHONY: html_meta
205205
html_meta: deps ## Add meta data headers to all Markdown pages
@@ -212,7 +212,7 @@ doctest: deps
212212
"results in $(BUILDDIR)/doctest/output.txt."
213213

214214
.PHONY: test
215-
test: clean linkcheckbroken spellcheck ## Clean docs build, then run linkcheckbroken, spellcheck
215+
test: clean linkcheckbroken ## Clean docs build, then run linkcheckbroken
216216

217217
.PHONY: deploy
218218
deploy: clean html
@@ -241,4 +241,4 @@ storybook:
241241
cd submodules/volto && yarn && yarn build-storybook -o ../../_build/html/storybook
242242

243243
.PHONY: all
244-
all: clean spellcheck linkcheck html ## Clean docs build, then run linkcheck and spellcheck, and build html
244+
all: clean vale linkcheck html ## Clean docs build, then run vale and linkcheck, and build html

docs/backend/upgrading/version-specific-migration/upgrade-to-python3.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -305,16 +305,6 @@ These should be changed so that Python 3 is the default.
305305
For example, string types (or text) should be represented as `'foo'`, not `u'foo'`, and bytes types (or data) should be represented as `b'bar'`, not `'bar'`.
306306
Search for examples of `Py23DocChecker` in Plone's packages to find a pattern which allows updated doctests to pass in Python 2.
307307

308-
- To test your code against `buildout.coredev`, start by browsing to [Add-ons \[Jenkins\]](https://jenkins.plone.org/view/Add-ons/).
309-
- Note there are jobs set up for Plone 4.3, 5.0, 5.1, and 5.2 on Python 2, and three jobs that run tests for Plone 5.2 on Python 3.6, Python 3.7, Python 3.8, and Python 3.9.
310-
- Click the link {guilabel}`log in` on Jenkins website (top right).
311-
For the first login, you must authorize Jenkins to have access to your GitHub account to authenticate.
312-
- Click the link for the job you want to run.
313-
For example, {guilabel}`Test add-on against Plone 5.2 on Python3.8`.
314-
- Choose the link {guilabel}`Build with parameters` in the menu on the left-hand side.
315-
- Fill the fields {guilabel}`ADDON_URL` and {guilabel}`ADDON_BRANCH` with your repository's URL and the branch name ("python3" if you followed these instructions).
316-
- Start the build with the {guilabel}`Build` button.
317-
318308

319309
## 7. Update add-on information
320310

docs/conf.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"sphinx_sitemap",
5353
"sphinxcontrib.httpdomain", # plone.restapi
5454
"sphinxcontrib.httpexample", # plone.restapi
55-
"sphinxcontrib.spelling",
5655
"sphinxext.opengraph",
5756
"sphinx.ext.viewcode", # plone.api
5857
"sphinx.ext.autosummary", # plone.api
@@ -97,10 +96,6 @@
9796
linkcheck_timeout = 10
9897
linkcheck_retries = 2
9998

100-
# This is our wordlist with known words, like Github or Plone ...
101-
spelling_word_list_filename = "spelling_wordlist.txt"
102-
spelling_ignore_pypi_package_names = True
103-
10499
# The suffix of source filenames.
105100
source_suffix = {
106101
".md": "markdown",
@@ -128,6 +123,7 @@
128123
"plone.restapi/news",
129124
"plone.restapi/performance",
130125
"plone.restapi/src",
126+
"volto/developer-guidelines/branch-policy.md",
131127
]
132128

133129
html_js_files = [
@@ -312,7 +308,8 @@ def source_replace(app, docname, source):
312308

313309
# Dict of replacements.
314310
source_replacements = {
315-
"{PLONE_BACKEND_VERSION}": "6.0.0b3",
311+
"{PLONE_BACKEND_MINOR_VERSION}": "6.0",
312+
"{PLONE_BACKEND_PATCH_VERSION}": "6.0.0.1",
316313
}
317314

318315

docs/contributing/authors.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ myst:
44
"description": "Authors' guide to writing Plone Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."
55
"property=og:description": "Authors' guide to writing Plone Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."
66
"property=og:title": "Authors Guide"
7-
"keywords": "Plone, Documentation, SEO, meta, exercises, solutions, spellcheck, linkcheck, lexer"
7+
"keywords": "Plone, Documentation, SEO, meta, Vale, spell, grammar, style, check, linkcheck, lexer"
88
---
99

1010
(authors-guide-label)=
@@ -34,7 +34,7 @@ myst:
3434
"description": "Authors' guide to writing Plone Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."
3535
"property=og:description": "Authors' guide to writing Plone Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."
3636
"property=og:title": "Authors Guide"
37-
"keywords": "Plone, Documentation, SEO, meta, spellcheck, linkcheck, lexer"
37+
"keywords": "Plone, Documentation, SEO, meta, Vale, spell, grammar, style, check, linkcheck, lexer"
3838
---
3939
```
4040

@@ -44,7 +44,7 @@ This renders in the HTML `<head>` section as follows.
4444
<meta content="Authors' guide to writing Plone Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors." name="description" />
4545
<meta content="Authors' guide to writing Plone Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors." property="og:description" />
4646
<meta content="Authors Guide" property="og:title" />
47-
<meta content="Plone, Documentation, SEO, meta, spellcheck, linkcheck, lexer" name="keywords" />
47+
<meta content="Plone, Documentation, SEO, meta, Vale, spell, grammar, style, check, linkcheck, lexer" name="keywords" />
4848
```
4949

5050
Additional {term}`Open Graph` metadata is implemented through the Sphinx extension [`sphinxext-opengraph`](https://github.com/wpilibsuite/sphinxext-opengraph) and the [MyST `html_meta` directive](https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#setting-html-metadata), which resolves to the [Docutils `meta` directive](https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata).
@@ -75,25 +75,23 @@ Open `/_build/html/index.html` in a web browser.
7575

7676
(authors-english-label)=
7777

78-
### American English Spelling, Grammar, and Syntax
78+
### American English Spelling, Grammar, and Syntax, and Style Guide
7979

80-
Spellings are enforced through [`spellcheck`](https://sphinxcontrib-spelling.readthedocs.io/en/latest/index.html).
81-
We use the locale `en_US`.
80+
Spellings are enforced through [`Vale`](https://vale.sh/).
81+
Plone uses American English.
8282

83-
Spelling is configured in {file}`Makefile`, {file}`docs/conf.py`, and {file}`docs/spelling_wordlist.txt`.
83+
Spelling is configured in {file}`Makefile`, {file}`.vale.ini`, and in files in `styles/Vocab/Plone/`.
8484

85-
Authors should add new words and proper names using correct casing to {file}`docs/spelling_wordlist.txt`, sorted alphabetically.
85+
Authors should add new words and proper names using correct casing to {file}`styles/Vocab/Plone/accept.txt`, sorted alphabetically and case-insensitive.
8686

87-
See [default settings and configuration options](https://sphinxcontrib-spelling.readthedocs.io/en/latest/customize.html).
87+
Vale also provides English grammar and syntax checking, as well as a Style Guide.
8888

89-
To validate spelling, run the following command.
89+
To perform all these checks, run the following command.
9090

9191
```shell
92-
make spellcheck
92+
make vale
9393
```
9494

95-
Open `/_build/spellcheck/` for misspellings.
96-
9795
Because it is difficult to automate good English grammar and syntax, we do not strictly enforce it.
9896
We also understand that contributors might not be fluent in English.
9997
We encourage contributors to make a reasonable effort, and to seek help from community members who are fluent in English.

docs/contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ This section describes how to make contributions to files in the `plone/document
153153
```
154154
155155
```{note}
156-
Eventually the `spellcheck` build will be required, but not at this time.
156+
Eventually the `vale` build will be required, but not at this time.
157157
We welcome improvements to the dictionary.
158158
```
159159

docs/contributing/setup-build.md

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ myst:
44
"description": "How to set up the Plone Documentation locally"
55
"property=og:description": "How to set up the Plone Documentation locally"
66
"property=og:title": "Building and Checking the Quality of Documentation"
7-
"keywords": "setup, build, documentation, quality, development, spellcheck, linkcheck"
7+
"keywords": "setup, build, documentation, quality, development, Vale, spell, grammar, style, check, linkcheck"
88
---
99

1010
(setup-build-label)=
@@ -18,20 +18,40 @@ This document covers how to build the Plone Documentation and check it for quali
1818

1919
## Installation
2020

21-
Install [Enchant](https://abiword.github.io/enchant/) to check spelling.
21+
Installation of Plone 6 Documentation includes pre-requisites and the repository itself.
2222

23-
**macOS**
2423

25-
```shell
26-
brew install enchant
27-
```
24+
(setup-build-installation-vale-label)=
2825

29-
**Ubuntu**
26+
### Vale
3027

31-
```shell
32-
sudo apt-get install enchant
28+
Vale is a linter for narrative text.
29+
It checks spelling, English grammar, and style guides.
30+
Plone documentation uses a custom spelling dictionary, with accepted and rejected spellings in `styles/Vocab/Plone`.
31+
32+
Use your operating system's package manager to [install Vale](https://vale.sh/docs/vale-cli/installation/).
33+
34+
Vale also has [integrations](https://vale.sh/docs/integrations/guide/) with various IDEs.
35+
36+
- [JetBrains](https://vale.sh/docs/integrations/jetbrains/)
37+
- [Vim](https://github.com/dense-analysis/ale)
38+
- [VS Code](https://github.com/errata-ai/vale-vscode)
39+
40+
Plone documentation uses a file located at the root of the repository, `.vale.ini`, to configure Vale.
41+
This file allows overriding rules or changing their severity.
42+
43+
The Plone Documentation Team selected the [Microsoft Writing Style Guide](https://docs.microsoft.com/en-us/style-guide/welcome/) for its ease of use—especially for non-native English readers and writers—and attention to non-technical audiences.
44+
45+
```{note}
46+
More corrections to spellings and Vale's configuration are welcome by submitting a pull request.
47+
This is an easy way to become a contributor to Plone.
3348
```
3449

50+
51+
(setup-build-installation-clone-plone-documentation-label)=
52+
53+
### Clone `plone/documentation`
54+
3555
Clone the Plone Documentation repository, and change your working directory into the cloned project.
3656
Then with a single command using `Makefile`, create a Python virtual environment, install project dependencies, pull in Volto documentation as a git submodule, build the docs, and view the results in a web browser by opening `/_build/html/index.html`.
3757

@@ -41,11 +61,6 @@ cd documentation
4161
make html
4262
```
4363

44-
```{note}
45-
If you are using an M1 Mac to build the documentation, there is currently [an issue with pyenchant](https://github.com/pyenchant/pyenchant/issues/265) that throws an error that the enchant library can't be found.
46-
This happens for example if you install Python 3 with `pyenv` in the default M1 architecture (aarch64), so without following instructions to use Rosetta2 x86 emulation.
47-
A workaround until pyenchant is fixed is to run `export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.dylib` in the terminal session before you execute `make html`.
48-
```
4964

5065
(setup-build-available-documentation-builds-label)=
5166

@@ -96,16 +111,16 @@ make linkcheck
96111
Open `/_build/linkcheck/output.txt` for a list of broken links.
97112

98113

99-
### `spellcheck`
114+
### `vale`
100115

101-
`spellcheck` checks the spelling of words.
116+
`vale` checks for American English spelling, grammar, syntax, and the Microsoft Developer Style Guide.
102117
See {ref}`authors-english-label` for configuration.
103118

104119
```shell
105-
make spellcheck
120+
make vale
106121
```
107122

108-
Open `/_build/spellcheck/` for misspellings.
123+
See the output on the console for suggestions.
109124

110125

111126
### `html_meta`

0 commit comments

Comments
 (0)