From 01d74994bcfe22c01b84bb48665f0380ee8789ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 2 Jun 2020 10:47:10 -0400 Subject: [PATCH] Switch from recommonmark to MyST parser for Sphinx --- conf.py | 27 +++++++++++++++------------ requirements.txt | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/conf.py b/conf.py index 7f023b5..87ef0eb 100644 --- a/conf.py +++ b/conf.py @@ -16,8 +16,6 @@ # import sys # sys.path.insert(0, os.path.abspath('.')) -import recommonmark -from recommonmark.transform import AutoStructify # -- Project information ----------------------------------------------------- @@ -41,10 +39,10 @@ release = u'' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.todo', - 'recommonmark', 'myst_parser', + 'sphinx.ext.autodoc', + 'sphinx.ext.autosectionlabel', + 'sphinx.ext.todo', ] # Add any paths that contain templates here, relative to this directory. @@ -208,11 +206,16 @@ epub_exclude_files = ['search.html'] # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True -# App set-up hook to enable embedding ReStructuredText in Markdown. + +autodoc_member_order = "bysource" + +nitpick_ignore = [ + ("py:class", "Any"), + ("py:class", "Tuple"), + ("py:class", "ForwardRef"), + ("py:class", "NoneType"), + ("py:class", "TableRow"), +] + def setup(app): - app.add_config_value('recommonmark_config', { - 'enable_auto_toc_tree': True, - 'auto_toc_tree_section': 'Contents', - 'enable_eval_rst': True, - }, True) - app.add_transform(AutoStructify) + """Add functions to the Sphinx setup.""" diff --git a/requirements.txt b/requirements.txt index 002e1d6..1f65396 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -git+https://github.com/readthedocs/recommonmark.git +myst-parser[sphinx]