1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
From: Cimbali <me@cimba.li>
Date: Sun, 30 Jan 2022 11:26:31 +0100
Subject: Replace deprecated recommonmark with myst-parser
Fixes #237
---
docs/conf.py | 12 +-----------
docs/index.md | 12 ++++++++----
docs/pympress.md | 2 +-
setup.cfg | 3 +--
4 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index b92b189..32c2881 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -21,7 +21,6 @@ import sys
import pathlib
sys.path.insert(0, pathlib.Path(__file__).resolve().parents[1])
-from recommonmark.transform import AutoStructify
import re
import subprocess
import importlib
@@ -39,7 +38,7 @@ needs_sphinx = '1.3' # for sphinx.ext.napoleon
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
- 'recommonmark',
+ 'myst_parser',
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
@@ -74,15 +73,6 @@ def rewrite_link(url):
def setup(app):
""" Function called by sphinx to setup this documentation.
"""
- app.add_config_value('recommonmark_config', {
- 'url_resolver': lambda url: url[3:] if url.startswith('../README') else url,
- 'enable_auto_toc_tree': True,
- 'auto_toc_maxdepth': 2,
- 'auto_toc_tree_section': 'Contents',
- 'enable_eval_rst': True
- }, True)
- app.add_transform(AutoStructify)
-
# get the README.md as a source, but we need to move it here and adjust the relative links into docs/
# Until relative links are allowed from the toctree, see https://github.com/sphinx-doc/sphinx/issues/701
find_links = re.compile(r'\[([^\[\]]+)\]\(([^()]+)\)')
diff --git a/docs/index.md b/docs/index.md
index 22ad4a0..c9f7d82 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -2,14 +2,18 @@
## Contents
-- [Readme](../README.md)
-- [Configuration file](./options.md)
-- [Module documentation](./pympress.md)
+```{toctree}
+:maxdepth: 2
+
+README.md
+options.md
+pympress.md
+```
## Indices and tables
-```eval_rst
+```{eval-rst}
* :ref:`genindex`
* :ref:`modindex`
```
diff --git a/docs/pympress.md b/docs/pympress.md
index 5c55088..8d685e7 100644
--- a/docs/pympress.md
+++ b/docs/pympress.md
@@ -8,7 +8,7 @@ Retructured text (rst) can be used inside the comments and docstrings.
## Modules
-```eval_rst
+```{eval-rst}
.. automodule:: pympress.__main__
:members:
:undoc-members:
diff --git a/setup.cfg b/setup.cfg
index 55e3c58..6aa666d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -47,9 +47,8 @@ build_requires =
[options.extras_require]
build_sphinx =
- docutils==0.16
sphinx
- recommonmark
+ myst-parser
sphinxcontrib-napoleon
sphinx-rtd-theme
babel =
|