Skip to content

Commit 12b4b89

Browse files
authored
Add support for tooltips, attrs_block, attrs_inline, and strikethrough (#1905)
1 parent 0a480f1 commit 12b4b89

File tree

4 files changed

+38
-16
lines changed

4 files changed

+38
-16
lines changed

docs/conf.py

+17-7
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"sphinx_examples",
5959
"sphinx_reredirects",
6060
"sphinx_sitemap",
61+
"sphinx_tippy",
6162
"sphinxcontrib.httpdomain", # plone.restapi
6263
"sphinxcontrib.httpexample", # plone.restapi
6364
"sphinxcontrib.mermaid",
@@ -302,15 +303,14 @@
302303
# For more information see:
303304
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
304305
myst_enable_extensions = [
305-
"deflist", # Support definition lists.
306-
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#definition-lists
307-
"linkify", # Identify "bare" web URLs and add hyperlinks.
308-
"colon_fence", # You can also use ::: delimiters to denote code fences,\
309-
# instead of ```.
310-
"substitution", # plone.restapi \
311-
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2
306+
"attrs_block", # Support parsing of block attributes.
307+
"attrs_inline", # Support parsing of inline attributes.
308+
"colon_fence", # You can also use ::: delimiters to denote code fences, instead of ```.
309+
"deflist", # Support definition lists. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#definition-lists
312310
"html_image", # For inline images. See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images
311+
"linkify", # Identify "bare" web URLs and add hyperlinks.
313312
"strikethrough", # See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-strikethrough
313+
"substitution", # Use Jinja2 for substitutions. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2
314314
]
315315

316316
myst_substitutions = {
@@ -406,6 +406,16 @@
406406
sitemap_filename = "sitemap-custom.xml"
407407

408408

409+
# -- sphinx-tippy configuration ----------------------------------
410+
tippy_anchor_parent_selector = "article.bd-article"
411+
tippy_enable_doitips = False
412+
tippy_enable_wikitips = False
413+
tippy_props = {
414+
"interactive": True,
415+
"placement": "auto-end",
416+
}
417+
418+
409419
# -- Options for HTML help output -------------------------------------------------
410420

411421
# Output file base name for HTML help builder.

docs/contributing/documentation/myst-reference.md

+7
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,13 @@ This is MyST syntax for term ``{term}`React` ``
415415
```
416416

417417

418+
### Strikethrough
419+
420+
```{example}
421+
This is MyST markup for ~~strikethrough~~ inline text format.
422+
```
423+
424+
418425
### Glossary terms
419426

420427
Add a term to the {ref}`glossary-label`, located at {file}`/glossary.md`.

docs/contributing/documentation/themes-and-extensions.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,41 @@ We use several MyST and Sphinx extensions to enhance the presentation of Plone d
3030

3131
### MyST
3232

33+
- [`attrs_block`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#block-attributes) supports parsing of block attributes before certain block syntaxes.
34+
- [`attrs_inline`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#inline-attributes) supports parsing of inline attributes before certain inline syntaxes.
35+
- [`colon_fence`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#code-fences-using-colons) supports the use of three colons `:::` as delimiters to denote code fences, instead of three backticks `` ``` ``.
3336
- [`deflist`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#definition-lists) supports definition lists.
37+
- [`html_image`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images) supports the use of HTML `<img>` tags.
3438
- [`linkify`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#linkify) identifies "bare" web URLs and adds hyperlinks.
35-
- [`colon_fence`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#code-fences-using-colons) supports the use of three colons `:::` as delimiters to denote code fences, instead of three backticks `` ``` ``.
39+
- [`strikethrough`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-strikethrough) supports the use of strikethrough markup.
3640
- [`substitution`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2) supports the use of substitutions with Jinja2.
37-
- [`html_image`](https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images) supports the use of HTML `<img>` tags.
3841

3942

4043
### Sphinx
4144

4245
- [`myst_parser`](https://myst-parser.readthedocs.io/en/latest/) parses MyST, a rich and extensible flavour of Markdown for authoring documentation.
4346
- [`sphinx-design`](https://sphinx-design.readthedocs.io/en/latest/), with a configuration name of `sphinx_design`, adds grids, cards, icons, badges, buttons, tabs, and dropdowns.
4447
- [`sphinx-examples`](https://ebp-sphinx-examples.readthedocs.io/en/latest/) adds "example snippets" that allow you to show off source Markdown and the result of rendering it in Sphinx.
45-
- [`sphinx-notfound-page`](https://sphinx-notfound-page.readthedocs.io/en/latest/index.html), with a configuration name of `notfound.extension`, creates a custom 404 page and helps generate proper static resource links to render the page properly.
48+
- [`sphinx-notfound-page`](https://sphinx-notfound-page.readthedocs.io/en/latest/index.html), with a configuration name of `notfound.extension`, creates a custom 404 page and helps generate proper static resource links to render the page.
49+
- [`sphinx-tippy`](https://sphinx-tippy.readthedocs.io/en/latest/), with a configuration name of `sphinx_tippy`, provides hover tips in your documentation.
4650
- [`sphinx.ext.autodoc`](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html) pulls in documentation from Python docstrings to generate reStructuredText which in turn gets parsed by Sphinx and rendered to the output format.
47-
It is used by {doc}`/plone.api/index`.
51+
It's used by {doc}`/plone.api/index`.
4852
- [`sphinx.ext.autosummary`](https://www.sphinx-doc.org/en/master/usage/extensions/autosummary.html) generates function/method/attribute summary lists.
49-
It is used by {doc}`/plone.api/index`.
53+
It's used by {doc}`/plone.api/index`.
5054
- [`sphinx.ext.graphviz`](https://www.sphinx-doc.org/en/master/usage/extensions/graphviz.html) allows you to embed [Graphviz](https://graphviz.org/download/) graphs in your documents.
5155
- [`sphinx.ext.ifconfig`](https://www.sphinx-doc.org/en/master/usage/extensions/ifconfig.html) includes content based on configuration.
5256
- [`sphinx.ext.intersphinx`](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html) provides linking between separate projects that use Sphinx for documentation.
5357
- [`sphinx.ext.todo`](https://www.sphinx-doc.org/en/master/usage/extensions/todo.html) adds support for todo items.
5458
- [`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.
55-
It is used by {doc}`/plone.api/index`.
59+
It's used by {doc}`/plone.api/index`.
5660
- [`sphinx_copybutton`](https://sphinx-copybutton.readthedocs.io/en/latest/index.html) adds a little "copy" button to the right of code blocks.
5761
- [`sphinx_reredirects`](https://documatt.com/sphinx-reredirects/) handles redirects for moved pages.
5862
- [`sphinx_sitemap`](https://pypi.org/project/sphinx-sitemap/) generates multiversion and multilanguage [sitemaps.org](https://www.sitemaps.org/protocol.html) compliant sitemaps.
5963
- [`sphinxcontrib.httpdomain`](https://sphinxcontrib-httpdomain.readthedocs.io/en/stable/) provides a Sphinx domain for describing HTTP APIs.
60-
It is used by Plone's {doc}`/plone.restapi/docs/source/index`.
64+
It's used by Plone's {doc}`/plone.restapi/docs/source/index`.
6165
- [`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.
62-
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/).
63-
It is used by Plone's {doc}`/plone.restapi/docs/source/index`.
66+
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/).
67+
It's used by Plone's {doc}`/plone.restapi/docs/source/index`.
6468
- [`sphinxcontrib.mermaid`](https://pypi.org/project/sphinxcontrib-mermaid/) allows you to embed [Mermaid](https://mermaid.js.org/) graphs in your documents, including general flowcharts, sequence diagrams, and Gantt charts.
6569
- [`sphinxcontrib.video`](https://pypi.org/project/sphinxcontrib-video/) allows you to embed local videos as defined by the HTML5 standard.
6670
- [`sphinxcontrib.youtube`](https://pypi.org/project/sphinxcontrib-video/) allows you to embed remotely hosted videos from [YouTube](https://www.youtube.com/), [Vimeo](https://vimeo.com/), or [PeerTube](https://joinpeertube.org/).

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ sphinx-examples
77
sphinx-notfound-page # Documentation only
88
sphinx-reredirects
99
sphinx-sitemap
10+
sphinx-tippy
1011
sphinxcontrib.httpdomain # plone.restapi
1112
sphinxcontrib.httpexample # plone.restapi
1213
sphinxcontrib-video

0 commit comments

Comments
 (0)