You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/community/contributing.md
+6-255Lines changed: 6 additions & 255 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -281,117 +281,16 @@ If no other lexer works well, then fall back to `text`.
281
281
At least then the build will succeed without warnings, although syntax highlighting for such snippets will not appear.
282
282
283
283
284
-
#### Validate the lexer
285
-
286
-
Always build the page to validate syntax.
287
-
The change should not be merged if there are any Sphinx warnings.
288
-
The Sphinx console will display any warnings, such as the following.
289
-
290
-
```console
291
-
/OpenSPP/documentation/classic-ui/bodyclasses.md:10: WARNING: Could not lex literal_block as "python". Highlighting skipped.
292
-
```
293
-
294
-
The above warning indicates that the syntax is not valid.
295
-
Common mistakes include:
296
-
297
-
- Using `...` or `…` to indicate omitted code.
298
-
It is preferable to never use ellipses.
299
-
If you must do that, comment it out using the language's comment syntax.
300
-
- Using comments in JSON.
301
-
- A previous code block bleeds through to the next due to invalid MyST syntax.
302
-
303
-
To validate code block syntax, run the following command.
304
-
305
-
```shell
306
-
make html
307
-
```
308
-
309
-
An [online demo of all lexers that Pygments supports](https://pygments.org/demo/) may be helpful to test out your code blocks and snippets for syntax highlighting.
310
-
You can also use the [`pygmentize`](https://pygments.org/docs/cmdline/) binary.
311
-
312
-
When using the online lexer, if any red-bordered rectangles appear, then the lexer for Pygments interprets your snippet as not valid.
313
-
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.
314
-
315
-
316
-
### HTML and Open Graph metadata
317
-
318
-
All documents must have a `myst` topmatter key with an `html_meta` directive at the top of every page.
319
-
When rendered to HTML, it inserts `<meta>` tags for improved search engine results and nicer social media posts.
320
-
Authors should include at least `description`, `property=og:description`, `property=og:title`, and `keywords` meta tags.
321
-
322
-
The following is an example of `html_meta`.
323
-
Note that the content of the two tags `description` and `property=og:description` should be identical.
324
-
325
-
```md
326
-
---
327
-
myst:
328
-
html_meta:
329
-
"description": "Authors' guide to writing OpenSPP Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."
330
-
"property=og:description": "Authors' guide to writing OpenSPP Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."
This renders in the HTML `<head>` section as follows.
337
-
338
-
```html
339
-
<metacontent="Authors' guide to writing OpenSPP Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."name="description" />
340
-
<metacontent="Authors' guide to writing OpenSPP Documentation. It covers configuring quality checks and syntax for writing markup that is of particular interest to authors."property="og:description" />
Additional 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/configuration.html#setting-html-metadata), which resolves to the [Docutils `meta` directive](https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata).
346
-
See the site-wide configuration in {file}`conf.py`.
347
-
348
-
349
-
## OpenSPP documentation styleguide
350
-
351
-
We follow [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/).
352
-
353
-
Key concepts from that guide include the following.
354
-
355
-
- Documentation should be informational, but friendly.
356
-
- Address the reader by using "you" instead of "the user".
357
-
- Headings should be Sentence cased, not Title Cased.
358
-
359
-
The OpenSPP Documentation Team adopted additional guidelines.
360
-
361
-
- Use one sentence per line.
362
-
Keep sentences short and understandable.
363
-
This will greatly improve the editing and maintenance of your documentation.
364
-
365
-
- Do not follow PEP8 maximum line length standard.
366
-
Documentation is narrative text and images, not Python code.
367
-
368
-
- Use dashes `-` in filenames and avoid underscores.
369
-
370
-
- Images should be no wider than 740 pixels to fit within the documentation's main view port.
371
-
This avoids scaling and reducing legibility of images.
372
-
To make that work in Volto, set your browser width to 1180 pixels.
373
-
You will notice that the drag and trash icons for each block move inside the block from outside.
374
-
375
-
- In user documentation, provide screenshots of each step where the interface changes.
376
-
It is painstaking, but worth the effort.
377
-
Provide sufficient detail of what each option is and does.
378
-
379
-
380
-
## General documentation writing references
381
-
382
-
-[Write the Docs - Documentation Guide](https://www.writethedocs.org/guide/)
383
-
-[A Guide to Em Dashes, En Dashes, and Hyphens](https://www.merriam-webster.com/words-at-play/em-dash-en-dash-how-to-use)
384
-
385
284
## Documentation quality requirements
386
285
387
286
We use GitHub Actions with every pull request to enforce OpenSPP Documentation quality.
388
287
We recommend that you build the documentation locally to catch errors and warnings early on.
389
288
390
-
# MyST reference
289
+
###MyST reference
391
290
392
-
This chapter provides information and examples for how to write proper MyST syntax—with references to Sphinx extensions for their specific directives—in OpenSPP Documentation.
291
+
This section provides information and examples for how to write proper MyST syntax—with references to Sphinx extensions for their specific directives—in OpenSPP Documentation.
393
292
394
-
## MyST, reStructuredText, and Markdown
293
+
###MyST, reStructuredText, and Markdown
395
294
396
295
We use [MyST, or Markedly Structured Text](https://myst-parser.readthedocs.io/en/latest/), a rich and extensible flavor of Markdown, for authoring training documentation.
397
296
@@ -402,7 +301,7 @@ MyST may be more familiar to reStructuredText authors.
402
301
MyST allows the use of a fence and `{rst-eval}` to evaluate native reStructuredText.
403
302
This may be useful when Markdown does not provide sufficient flexibility, such as for `figure`.
404
303
405
-
## MyST syntax reference
304
+
####MyST syntax reference
406
305
407
306
The following are frequently used snippets and examples.
@@ -492,8 +391,6 @@ The main content area of a page in the documentation is 743 pixels wide.
492
391
When taking screenshots or videos, resize your browser window, or try to limit the width of your media to 740 pixels.
493
392
This will preserve legibility of images.
494
393
495
-
(enhance-images-label)=
496
-
497
394
#### Enhance images
498
395
499
396
We use cards from the Sphinx extension [`sphinx-design`](https://sphinx-design.readthedocs.io/en/latest/cards.html) to enhance the display and functionality of images.
@@ -540,7 +437,7 @@ The following MyST example will display as shown below.
540
437
```
541
438
````
542
439
543
-
```{image}../_static/standards.png
440
+
```{image} /_static/standards.png
544
441
:alt: XKCD "Standards" comic strip
545
442
```
546
443
@@ -626,11 +523,6 @@ Example MyST syntax is shown below.
626
523
627
524
Note that the path must be absolute to support both submodules and the main documentation.
OpenSPP documentation uses a file located at the root of the repository, `.vale.ini`, to configure Vale.
801
-
This file allows overriding rules or changing their severity.
802
-
803
-
The OpenSPP Documentation Team selected the [Microsoft Writing Style Guide](https://learn.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.
804
-
805
-
```{note}
806
-
More corrections to spellings and Vale's configuration are welcome by submitting a pull request.
807
-
This is an easy way to become a contributor to OpenSPP.
808
-
```
809
-
810
-
811
-
### Graphviz
812
-
813
-
Install [Graphviz](https://graphviz.org/download/) for graph visualization.
814
-
815
-
`````{tab-set}
816
-
````{tab-item} macOS
817
-
```shell
818
-
brew install graphviz
819
-
```
820
-
````
821
-
822
-
````{tab-item} Ubuntu
823
-
```shell
824
-
sudo apt-get install graphviz
825
-
```
826
-
````
827
-
`````
828
-
829
-
830
-
### Clone `OpenSPP/documentation`
831
-
832
-
Clone the OpenSPP Documentation repository, and change your working directory into the cloned project.
833
-
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`.
0 commit comments