docs: use MyST fieldlist and substitution

This commit is contained in:
Erik Sundell
2022-12-07 14:16:22 +01:00
parent f3bb3651b3
commit 71d5e604cb
2 changed files with 16 additions and 6 deletions

View File

@@ -2,10 +2,12 @@
# JupyterHub API # JupyterHub API
```{eval-rst} <!--
:Date: |today| Below is a MyST field list, using MyST substitution, as supported
:Release: |release| by enabling the respective MyST extensions in docs/source/conf.py.
``` -->
:Date: {{ date }}
:Release: {{ version }}
JupyterHub also provides a REST API for administration of the Hub and users. JupyterHub also provides a REST API for administration of the Hub and users.
The documentation on [Using JupyterHub's REST API](../reference/rest.md) provides The documentation on [Using JupyterHub's REST API](../reference/rest.md) provides

View File

@@ -20,8 +20,6 @@ from jupyterhub.app import JupyterHub
project = "JupyterHub" project = "JupyterHub"
author = "Project Jupyter Contributors" author = "Project Jupyter Contributors"
copyright = f"{datetime.date.today().year}, {author}" copyright = f"{datetime.date.today().year}, {author}"
version = "%i.%i" % jupyterhub.version_info[:2]
release = jupyterhub.__version__
# -- General Sphinx configuration -------------------------------------------- # -- General Sphinx configuration --------------------------------------------
@@ -48,11 +46,21 @@ default_role = "literal"
# ref: https://myst-parser.readthedocs.io/en/latest/configuration.html # ref: https://myst-parser.readthedocs.io/en/latest/configuration.html
# #
myst_heading_anchors = 2 myst_heading_anchors = 2
myst_enable_extensions = [ myst_enable_extensions = [
# available extensions: https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
"colon_fence", "colon_fence",
"deflist", "deflist",
"fieldlist",
"substitution",
] ]
myst_substitutions = {
# date example: Dev 07, 2022
"date": datetime.date.today().strftime("%b %d, %Y").title(),
"version": jupyterhub.__version__,
}
# -- Custom directives to generate documentation ----------------------------- # -- Custom directives to generate documentation -----------------------------
# ref: https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html # ref: https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html