|
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) ------------------------------------- |
|
46 | 44 | "sphinx.ext.todo", |
47 | 45 | "sphinx.ext.viewcode", |
48 | 46 | "sphinx_rtd_theme", |
49 | | - "recommonmark", |
| 47 | + "myst_parser", |
50 | 48 | ] |
51 | 49 |
|
52 | 50 | autodoc_typehints = 'description' |
|
72 | 70 |
|
73 | 71 | # Prefix each autosectionlabel with the name of the document it is in and a colon |
74 | 72 | autosectionlabel_prefix_document = True |
| 73 | +myst_heading_anchors = 2 |
75 | 74 |
|
76 | 75 | # Add any paths that contain templates here, relative to this directory. |
77 | 76 | templates_path = ['_templates'] |
|
210 | 209 | # Customize the html_theme |
211 | 210 | html_theme_options = {'navigation_depth': 3} |
212 | 211 |
|
213 | | -# Use m2r only for mdinclude and recommonmark for everything else |
214 | | -# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992 |
215 | 212 | 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 | + |
230 | 214 | app.add_css_file('custom.css') |
231 | 215 |
|
232 | 216 | # generate the components.rst file dynamically so it points to stable/latest |
|
0 commit comments