|
12 | 12 | # |
13 | 13 | import os |
14 | 14 | from pathlib import Path |
15 | | -from m2r import MdInclude |
16 | | -from recommonmark.transform import AutoStructify |
17 | 15 | from jinja2 import FileSystemLoader, Environment |
18 | 16 |
|
19 | 17 | # -- 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' |
|
55 | 53 |
|
56 | 54 | # Prefix each autosectionlabel with the name of the document it is in and a colon |
57 | 55 | autosectionlabel_prefix_document = True |
| 56 | +myst_heading_anchors = 2 |
58 | 57 |
|
59 | 58 | # Add any paths that contain templates here, relative to this directory. |
60 | 59 | templates_path = ['_templates'] |
|
203 | 202 | # Use m2r only for mdinclude and recommonmark for everything else |
204 | 203 | # https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992 |
205 | 204 | 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 | + |
220 | 206 | app.add_css_file('custom.css') |
221 | 207 |
|
222 | 208 | # generate the components.rst file dynamically so it points to stable/latest |
|
0 commit comments