diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2021-12-12 15:29:41 +0000 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2021-12-12 18:16:21 +0000 |
commit | 24aa48187e3dd34daf5d4cb8c7d01c839141c9b7 (patch) | |
tree | 40a3d5d87f91892b072884b3486242b326899224 /docs/source/conf.py | |
parent | 342cca436766febd122aaf94395355ec4baff894 (diff) | |
download | deluge-24aa48187e3dd34daf5d4cb8c7d01c839141c9b7.tar.gz deluge-24aa48187e3dd34daf5d4cb8c7d01c839141c9b7.tar.bz2 deluge-24aa48187e3dd34daf5d4cb8c7d01c839141c9b7.zip |
[Docs] Replace recommonmark with MyST parser
We used recommonmark so that we can use markdown in sphinx but it is
buggy and now so switch to better supported MyST-parser.
* Fixed incorrect heading warnings in markdown.
* Added sphinx toctree to markdown using directive as required by MyST.
* Upgraded Sphinx to 4.3
Ref: https://myst-parser.readthedocs.io
Diffstat (limited to 'docs/source/conf.py')
-rw-r--r-- | docs/source/conf.py | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py index 267e562af..f7db27efd 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,8 +14,6 @@ import os import sys from datetime import date -from recommonmark.states import DummyStateMachine -from recommonmark.transform import AutoStructify from six.moves import builtins from sphinx.ext import apidoc from sphinx.ext.autodoc import ClassDocumenter, bool_option @@ -50,6 +48,7 @@ extensions = [ 'sphinx.ext.napoleon', 'sphinx.ext.coverage', 'sphinxcontrib.spelling', + 'myst_parser', ] napoleon_include_init_with_doc = True @@ -59,7 +58,6 @@ napoleon_use_rtype = False templates_path = ['_templates'] # The suffix of source filenames. -source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'} source_suffix = ['.rst', '.md'] # The master toctree document. @@ -295,19 +293,6 @@ def maybe_skip_member(app, what, name, obj, skip, options): return True -# Monkey patch to fix recommonmark 0.4 doc reference issues. -orig_run_role = DummyStateMachine.run_role - - -def run_role(self, name, options=None, content=None): - if name == 'doc': - name = 'any' - return orig_run_role(self, name, options, content) - - -DummyStateMachine.run_role = run_role - - # Run the sphinx-apidoc to create package/modules rst files for autodoc. def run_apidoc(__): cur_dir = os.path.abspath(os.path.dirname(__file__)) @@ -329,5 +314,3 @@ def run_apidoc(__): def setup(app): app.connect('builder-inited', run_apidoc) app.connect('autodoc-skip-member', maybe_skip_member) - app.add_config_value('recommonmark_config', {}, True) - app.add_transform(AutoStructify) |