Skip to content

Commit 1adc82b

Browse files
authored
Merge pull request plone#1404 from plone/writing-docs-tips
Overhaul Contributing to Documentation
2 parents e161e88 + cd0df34 commit 1adc82b

File tree

7 files changed

+195
-134
lines changed

7 files changed

+195
-134
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See our [contributing guidelines](https://6.dev-docs.plone.org/contributing/index.html).
1+
See our [contributing guidelines](https://6.docs.plone.org/contributing/index.html).

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ Thank you for your contribution to the Plone Documentation.
22

33
Before submitting this pull request, please make sure you follow our guides:
44

5-
- [ ] [Contributing to Plone Documentation](https://6.dev-docs.plone.org/contributing/index.html)
6-
- [ ] [Building and Checking the Quality of Documentation](https://6.dev-docs.plone.org/contributing/setup-build.html)
7-
- [ ] [General Guide to Writing Documentation](https://6.dev-docs.plone.org/contributing/writing-docs-guide.html)
5+
- [Contributing to Plone documentation](https://6.docs.plone.org/contributing/index.html)
6+
- [Building and checking the quality of documentation](https://6.docs.plone.org/contributing/setup-build.html)
7+
- [Authors guide](https://6.docs.plone.org/contributing/authors.html)
8+
- [MyST reference](https://6.docs.plone.org/contributing/myst-reference.html)
89

910
## Issue Number
1011

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
"sphinx_sitemap",
5353
"sphinxcontrib.httpdomain", # plone.restapi
5454
"sphinxcontrib.httpexample", # plone.restapi
55+
"sphinxcontrib.video",
5556
"sphinxext.opengraph",
5657
"sphinx.ext.viewcode", # plone.api
5758
"sphinx.ext.autosummary", # plone.api
5859
"sphinx.ext.graphviz",
5960
"notfound.extension",
60-
"sphinxcontrib.video",
6161
]
6262

6363
graphviz_output_format = "svg"
@@ -155,7 +155,7 @@
155155
# instead of ```.
156156
"substitution", # plone.restapi \
157157
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2
158-
"html_image",
158+
"html_image", # For inline images. See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
159159
]
160160

161161
myst_substitutions = {

docs/contributing/authors.md

Lines changed: 81 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,22 @@ myst:
99

1010
(authors-guide-label)=
1111

12-
# Authors Guide
12+
# Authors guide
1313

1414
This guide is for authors of Plone Documentation.
15-
It covers configuring quality checks and syntax for writing markup that is of particular interest to authors.
16-
For general markup syntax, see {doc}`writing-docs-guide`.
15+
It covers how to run a live preview of documentation while editing, build documentation, and perform quality checks.
16+
For general markup syntax, see {doc}`myst-reference`.
1717

1818

19-
(authors-html-meta-data-label)=
20-
21-
## HTML and Open Graph Metadata
22-
23-
All documents must have a `myst` topmatter key with an `html_meta` directive at the top of every page.
24-
When rendered to HTML, it inserts `<meta>` tags for improved search engine results and nicer social media posts.
25-
Authors should include at least `description`, `property=og:description`, `property=og:title`, and `keywords` meta tags.
26-
27-
The following is an example of `html_meta`.
28-
Note that the content of the two tags `description` and `property=og:description` should be identical.
29-
30-
```md
31-
---
32-
myst:
33-
html_meta:
34-
"description": "Authors' guide to writing Plone Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."
35-
"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."
36-
"property=og:title": "Authors Guide"
37-
"keywords": "Plone, Documentation, SEO, meta, Vale, spell, grammar, style, check, linkcheck, lexer"
38-
---
39-
```
19+
## Synchronize the browser while editing
4020

41-
This renders in the HTML `<head>` section as follows.
21+
Use `sphinx-autobuild` to view changes in the browser while you edit documentation.
4222

43-
```html
44-
<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" />
45-
<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" />
46-
<meta content="Authors Guide" property="og:title" />
47-
<meta content="Plone, Documentation, SEO, meta, Vale, spell, grammar, style, check, linkcheck, lexer" name="keywords" />
23+
```shell
24+
make livehtml
4825
```
4926

50-
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).
51-
See the site-wide configuration in {file}`conf.py`.
27+
You can open a browser at http://127.0.0.1:8000/ to preview the documentation.
5228

5329

5430
(authors-quality-checks-label)=
@@ -62,7 +38,7 @@ We strive for high quality documentation, setting the following minimum standard
6238

6339
### Markup syntax must be valid
6440

65-
See both the specific markup syntax above and general markup in {doc}`writing-docs-guide`.
41+
See both the specific markup syntax above and general markup in {doc}`myst-reference`.
6642

6743
To validate markup, run the following command.
6844

@@ -75,7 +51,7 @@ Open `/_build/html/index.html` in a web browser.
7551

7652
(authors-english-label)=
7753

78-
### American English Spelling, Grammar, and Syntax, and Style Guide
54+
### American English spelling, grammar, and syntax, and style guide
7955

8056
Spellings are enforced through [`Vale`](https://vale.sh/).
8157
Plone uses American English.
@@ -85,17 +61,18 @@ Spelling is configured in {file}`Makefile`, {file}`.vale.ini`, and in files in `
8561
Authors should add new words and proper names using correct casing to {file}`styles/Vocab/Plone/accept.txt`, sorted alphabetically and case-insensitive.
8662

8763
Vale also provides English grammar and syntax checking, as well as a Style Guide.
64+
We follow the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/).
8865

8966
To perform all these checks, run the following command.
9067

9168
```shell
9269
make vale
9370
```
9471

95-
Because it is difficult to automate good English grammar and syntax, we do not strictly enforce it.
72+
Because it is difficult to automate good American English grammar and syntax, we do not strictly enforce it.
9673
We also understand that contributors might not be fluent in English.
97-
We encourage contributors to make a reasonable effort, and to seek help from community members who are fluent in English.
98-
When you submit a pull request, please select a Reviewer to review your work.
74+
We encourage contributors to make a reasonable effort, and to request a review of their pull request from community members who are fluent in English to fix grammar and syntax.
75+
Please ask!
9976

10077

10178
(authors-linkcheck-label)=
@@ -188,7 +165,7 @@ If no other lexer works well, then fall back to `text`.
188165
At least then the build will succeed without warnings, although syntax highlighting for such snippets will not appear.
189166

190167

191-
#### Validate the Lexer
168+
#### Validate the lexer
192169

193170
Always build the page to validate syntax.
194171
The change should not be merged if there are any Sphinx warnings.
@@ -220,12 +197,73 @@ When using the online lexer, if any red-bordered rectangles appear, then the lex
220197
You can search the [Pygments issue tracker](https://github.com/pygments/pygments/search) for possible solutions, or submit a pull request to enhance the lexer.
221198

222199

223-
## Synchronize the Browser While Editing
200+
(authors-html-meta-data-label)=
224201

225-
Use `sphinx-autobuild` to view changes in the browser while editing documentation.
202+
### HTML and Open Graph metadata
226203

227-
```shell
228-
make livehtml
204+
All documents must have a `myst` topmatter key with an `html_meta` directive at the top of every page.
205+
When rendered to HTML, it inserts `<meta>` tags for improved search engine results and nicer social media posts.
206+
Authors should include at least `description`, `property=og:description`, `property=og:title`, and `keywords` meta tags.
207+
208+
The following is an example of `html_meta`.
209+
Note that the content of the two tags `description` and `property=og:description` should be identical.
210+
211+
```md
212+
---
213+
myst:
214+
html_meta:
215+
"description": "Authors' guide to writing Plone Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."
216+
"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."
217+
"property=og:title": "Authors Guide"
218+
"keywords": "Plone, Documentation, SEO, meta, Vale, spell, grammar, style, check, linkcheck, lexer"
219+
---
229220
```
230221

231-
You can open a browser at http://127.0.0.1:8000/ to preview the documentation.
222+
This renders in the HTML `<head>` section as follows.
223+
224+
```html
225+
<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" />
226+
<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" />
227+
<meta content="Authors Guide" property="og:title" />
228+
<meta content="Plone, Documentation, SEO, meta, Vale, spell, grammar, style, check, linkcheck, lexer" name="keywords" />
229+
```
230+
231+
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).
232+
See the site-wide configuration in {file}`conf.py`.
233+
234+
235+
## Plone documentation styleguide
236+
237+
We follow [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/).
238+
239+
Key concepts from that guide include the following.
240+
241+
- Documentation should be informational, but friendly.
242+
- Address the reader by using "you" instead of "the user".
243+
- Headings should be Sentence cased, not Title Cased.
244+
245+
The Plone Documentation Team adopted additional guidelines.
246+
247+
- Use one sentence per line.
248+
Keep sentences short and understandable.
249+
This will greatly improve the editing and maintenance of your documentation.
250+
251+
- Do not follow PEP8 maximum line length standard.
252+
Documentation is narrative text and images, not Python code.
253+
254+
- Use dashes `-` in filenames and avoid underscores.
255+
256+
- Images should be no wider than 740 pixels to fit within the documentation's main view port.
257+
This avoids scaling and reducing legibility of images.
258+
To make that work in Volto, set your browser width to 1180 pixels.
259+
You will notice that the drag and trash icons for each block move inside the block from outside.
260+
261+
- In user documentation, provide screenshots of each step where the interface changes.
262+
It is painstaking, but worth the effort.
263+
Provide sufficient detail of what each option is and does.
264+
265+
266+
## General documentation writing references
267+
268+
- [Write the Docs - Documentation Guide](https://www.writethedocs.org/guide/)
269+
- [A Guide to Em Dashes, En Dashes, and Hyphens](https://www.merriam-webster.com/words-at-play/em-dash-en-dash-how-to-use)

docs/contributing/index.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ myst:
99

1010
(contributing-index-label)=
1111

12-
# Contributing to Documentation
12+
# Contributing to documentation
1313

1414
This document describes how to contribute to Plone Documentation.
1515

@@ -36,15 +36,15 @@ A copy of the license is included in the root of this repository.
3636

3737
(contributing-roles-label)=
3838

39-
## Contributor Roles
39+
## Contributor roles
4040

4141
Contributors to the Plone Documentation may perform one or many roles.
4242

4343
- **Plone users and developers** use this documentation because it is accurate and actively maintained.
4444
People in these roles typically contribute minor corrections.
45-
They should read {doc}`setup-build` and {doc}`writing-docs-guide`.
45+
They should read {doc}`setup-build` and {doc}`myst-reference`.
4646
- **Authors** create Plone Documentation.
47-
They should read {doc}`setup-build` and {doc}`writing-docs-guide`.
47+
They should read {doc}`setup-build` and {doc}`myst-reference`.
4848
They should also read {doc}`authors` for guidance and tips for writing good technical documentation.
4949

5050

@@ -287,7 +287,8 @@ hidden: true
287287
---
288288
289289
setup-build
290-
writing-docs-guide
291290
authors
291+
myst-reference
292+
sphinx-extensions
292293
admins
293294
```

0 commit comments

Comments
 (0)