Skip to content

Commit 67ead96

Browse files
committed
Update markdown parsing to MyST
1 parent 9905aa3 commit 67ead96

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

docs/source/conf.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#
1313
import os
1414
from pathlib import Path
15-
from m2r import MdInclude
16-
from recommonmark.transform import AutoStructify
1715
from jinja2 import FileSystemLoader, Environment
1816

1917
# -- 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'
@@ -55,6 +53,7 @@
5553

5654
# Prefix each autosectionlabel with the name of the document it is in and a colon
5755
autosectionlabel_prefix_document = True
56+
myst_heading_anchors = 2
5857

5958
# Add any paths that contain templates here, relative to this directory.
6059
templates_path = ['_templates']
@@ -203,20 +202,7 @@
203202
# Use m2r only for mdinclude and recommonmark for everything else
204203
# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992
205204
def setup(app):
206-
config = {
207-
# 'url_resolver': lambda url: github_doc_root + url,
208-
'auto_toc_tree_section': 'Contents',
209-
'enable_eval_rst': True,
210-
}
211-
app.add_config_value('recommonmark_config', config, True)
212-
app.add_transform(AutoStructify)
213-
214-
# from m2r to make `mdinclude` work
215-
app.add_config_value('no_underscore_emphasis', False, 'env')
216-
app.add_config_value('m2r_parse_relative_links', False, 'env')
217-
app.add_config_value('m2r_anonymous_references', False, 'env')
218-
app.add_config_value('m2r_disable_inline_math', False, 'env')
219-
app.add_directive('mdinclude', MdInclude)
205+
220206
app.add_css_file('custom.css')
221207

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

0 commit comments

Comments
 (0)