|
13 | 13 | import copy
|
14 | 14 | import os
|
15 | 15 | from pathlib import Path
|
16 |
| -from m2r import MdInclude |
17 |
| -from recommonmark.transform import AutoStructify |
18 | 16 | from jinja2 import FileSystemLoader, Environment
|
19 | 17 | try:
|
20 | 18 | import importlib.metadata as importlib_metadata
|
|
51 | 49 | "sphinx.ext.todo",
|
52 | 50 | "sphinx.ext.viewcode",
|
53 | 51 | "sphinx_rtd_theme",
|
54 |
| - "recommonmark", |
| 52 | + "myst_parser", |
55 | 53 | ]
|
56 | 54 |
|
57 | 55 | autodoc_typehints = 'description'
|
@@ -108,6 +106,7 @@ def set_process_name(self,*args,**kwargs):
|
108 | 106 |
|
109 | 107 | # Prefix each autosectionlabel with the name of the document it is in and a colon
|
110 | 108 | autosectionlabel_prefix_document = True
|
| 109 | +myst_heading_anchors = 2 |
111 | 110 |
|
112 | 111 | # Add any paths that contain templates here, relative to this directory.
|
113 | 112 | templates_path = ['_templates']
|
@@ -246,23 +245,8 @@ def set_process_name(self,*args,**kwargs):
|
246 | 245 | # Customize the html_theme
|
247 | 246 | html_theme_options = {'navigation_depth': 3}
|
248 | 247 |
|
249 |
| -# Use m2r only for mdinclude and recommonmark for everything else |
250 |
| -# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992 |
251 | 248 | def setup(app):
|
252 |
| - config = { |
253 |
| - # 'url_resolver': lambda url: github_doc_root + url, |
254 |
| - 'auto_toc_tree_section': 'Contents', |
255 |
| - 'enable_eval_rst': True, |
256 |
| - } |
257 |
| - app.add_config_value('recommonmark_config', config, True) |
258 |
| - app.add_transform(AutoStructify) |
259 |
| - |
260 |
| - # from m2r to make `mdinclude` work |
261 |
| - app.add_config_value('no_underscore_emphasis', False, 'env') |
262 |
| - app.add_config_value('m2r_parse_relative_links', False, 'env') |
263 |
| - app.add_config_value('m2r_anonymous_references', False, 'env') |
264 |
| - app.add_config_value('m2r_disable_inline_math', False, 'env') |
265 |
| - app.add_directive('mdinclude', MdInclude) |
| 249 | + |
266 | 250 | app.add_css_file('custom.css')
|
267 | 251 |
|
268 | 252 | # generate the components.rst file dynamically so it points to stable/latest
|
|
0 commit comments