Skip to content

Commit 4fd393d

Browse files
committed
Modernize RTD build
1 parent 9387465 commit 4fd393d

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

docs/source/conf.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import copy
1414
import os
1515
from pathlib import Path
16-
from m2r import MdInclude
17-
from recommonmark.transform import AutoStructify
1816
from jinja2 import FileSystemLoader, Environment
1917

2018
# -- Project information (unique to each project) -------------------------------------
@@ -46,7 +44,7 @@
4644
"sphinx.ext.todo",
4745
"sphinx.ext.viewcode",
4846
"sphinx_rtd_theme",
49-
"recommonmark",
47+
"myst_parser",
5048
]
5149

5250
autodoc_typehints = 'description'
@@ -72,6 +70,7 @@
7270

7371
# Prefix each autosectionlabel with the name of the document it is in and a colon
7472
autosectionlabel_prefix_document = True
73+
myst_heading_anchors = 2
7574

7675
# Add any paths that contain templates here, relative to this directory.
7776
templates_path = ['_templates']
@@ -210,23 +209,8 @@
210209
# Customize the html_theme
211210
html_theme_options = {'navigation_depth': 3}
212211

213-
# Use m2r only for mdinclude and recommonmark for everything else
214-
# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992
215212
def setup(app):
216-
config = {
217-
# 'url_resolver': lambda url: github_doc_root + url,
218-
'auto_toc_tree_section': 'Contents',
219-
'enable_eval_rst': True,
220-
}
221-
app.add_config_value('recommonmark_config', config, True)
222-
app.add_transform(AutoStructify)
223-
224-
# from m2r to make `mdinclude` work
225-
app.add_config_value('no_underscore_emphasis', False, 'env')
226-
app.add_config_value('m2r_parse_relative_links', False, 'env')
227-
app.add_config_value('m2r_anonymous_references', False, 'env')
228-
app.add_config_value('m2r_disable_inline_math', False, 'env')
229-
app.add_directive('mdinclude', MdInclude)
213+
230214
app.add_css_file('custom.css')
231215

232216
# generate the components.rst file dynamically so it points to stable/latest

setup.cfg

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ gui_scripts =
4949
pyqt = PyQt5
5050
docs =
5151
PyQt5
52-
Sphinx==4.4.0
53-
sphinx-rtd-theme==0.5.2
54-
recommonmark==0.6.0
55-
m2r==0.2.1
56-
mistune<2.0.0
52+
Sphinx==7.2.6
53+
sphinx-rtd-theme==2.0.0
54+
myst_parser==2.0.0

0 commit comments

Comments
 (0)