|
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 |
|
20 | 18 | # -- Project information (unique to each project) ------------------------------------- |
|
47 | 45 | "sphinx.ext.todo", |
48 | 46 | "sphinx.ext.viewcode", |
49 | 47 | "sphinx_rtd_theme", |
50 | | - "recommonmark", |
| 48 | + "myst_parser", |
51 | 49 | ] |
52 | 50 |
|
53 | 51 | autodoc_typehints = 'description' |
|
73 | 71 |
|
74 | 72 | # Prefix each autosectionlabel with the name of the document it is in and a colon |
75 | 73 | autosectionlabel_prefix_document = True |
| 74 | +myst_heading_anchors = 2 |
76 | 75 |
|
77 | 76 | # Add any paths that contain templates here, relative to this directory. |
78 | 77 | templates_path = ['_templates'] |
|
211 | 210 | # Customize the html_theme |
212 | 211 | html_theme_options = {'navigation_depth': 3} |
213 | 212 |
|
214 | | -# Use m2r only for mdinclude and recommonmark for everything else |
215 | | -# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992 |
216 | 213 | def setup(app): |
217 | | - config = { |
218 | | - # 'url_resolver': lambda url: github_doc_root + url, |
219 | | - 'auto_toc_tree_section': 'Contents', |
220 | | - 'enable_eval_rst': True, |
221 | | - } |
222 | | - app.add_config_value('recommonmark_config', config, True) |
223 | | - app.add_transform(AutoStructify) |
224 | | - |
225 | | - # from m2r to make `mdinclude` work |
226 | | - app.add_config_value('no_underscore_emphasis', False, 'env') |
227 | | - app.add_config_value('m2r_parse_relative_links', False, 'env') |
228 | | - app.add_config_value('m2r_anonymous_references', False, 'env') |
229 | | - app.add_config_value('m2r_disable_inline_math', False, 'env') |
230 | | - app.add_directive('mdinclude', MdInclude) |
| 214 | + |
231 | 215 | app.add_css_file('custom.css') |
232 | 216 |
|
233 | 217 | # generate the components.rst file dynamically so it points to stable/latest |
|
0 commit comments