Skip to content

Commit bb10fad

Browse files
committed
Add sections for MyST extension html_image and videos
1 parent 3252112 commit bb10fad

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

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/myst-reference.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,21 @@ Use `image` for anything but diagrams.
107107

108108
Use `figure` for diagrams.
109109

110+
Paths to images and figures must resolve in both the main documentation and the submodule's documentation, if present.
111+
112+
For inline images, we use the MyST extension [`html_image`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images).
113+
Example syntax is shown below.
114+
115+
```html
116+
You can copy <img alt="Copy icon" src="../../_images/copy.svg" class="inline"> blocks.
117+
```
118+
119+
Note that the HTML attribute `class` must be set to `inline` to render the image inline at `1rem`.
120+
121+
The above syntax renders as shown below.
122+
123+
> You can copy <img alt="Copy icon" src="../../_images/copy.svg" class="inline"> blocks.
124+
110125
Images and figures should always include `alt` text.
111126

112127
From [Web Accessibility In Mind (WebAIM)](https://webaim.org/techniques/alttext/):
@@ -167,6 +182,35 @@ Accessibility is part of the [Plone brand and identity](https://plone.org/access
167182
```
168183

169184

185+
#### Video
186+
187+
To embed local videos, such as recordings of demonstrating the user interface, we require that the videos be saved as `.mp4` for greatest compatibility, usability, accessibility, and reduced file size.
188+
189+
Avoid animated GIFs because they do not allow control of playback.
190+
191+
Audio is not required, but may be helpful.
192+
If you include audio, it is helpful to include closed captions or a transcript.
193+
194+
It is helpful to include overlays of key strokes, and mouse and other input gestures, to describe how to interact with the user interface.
195+
196+
Paths to videos must resolve in both the main documentation and the submodule's documentation, if present.
197+
198+
Example syntax is shown below.
199+
200+
````
201+
```{video} /_static/user-manual/blocks/block-copy-cut.mp4
202+
:width: 100%
203+
```
204+
````
205+
206+
Note that the path must be absolute to support both submodules and the main documentation.
207+
The above MyST markup renders as shown below.
208+
209+
```{video} /_static/user-manual/blocks/block-copy-cut.mp4
210+
:width: 100%
211+
```
212+
213+
170214
#### Code block
171215

172216
A Python code snippet without reStructuredText options, using a simple fence.

docs/contributing/sphinx-extensions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ We use several Sphinx extensions to enhance the presentation of Plone documentat
2323
- [`sphinxcontrib.httpexample`](https://sphinxcontrib-httpexample.readthedocs.io/en/latest/) enhances `sphinxcontrib-httpdomain` by generating RESTful HTTP API call examples for different tools from a single HTTP request example.
2424
Supported tools include [curl](https://curl.se/), [wget](https://www.gnu.org/software/wget/), [httpie](https://httpie.io/), and [python-requests](https://requests.readthedocs.io/en/latest/).
2525
It is used by Plone's {doc}`plone.restapi/docs/source/index`.
26+
- [`sphinxcontrib.video`](https://pypi.org/project/sphinxcontrib-video/) allows you to embed local videos as defined by the HTML5 standard.
2627
- [`sphinxext.opengraph`](https://pypi.org/project/sphinxext-opengraph/) generates [OpenGraph metadata](https://ogp.me/).
2728
- [`sphinx.ext.viewcode`](https://www.sphinx-doc.org/en/master/usage/extensions/viewcode.html) generates pages of source code modules and links between the source and the description.
2829
It is used by {doc}`/plone.api/index`.

0 commit comments

Comments
 (0)