|
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 | try: |
19 | 17 | import importlib.metadata as importlib_metadata |
|
49 | 47 | "sphinx.ext.todo", |
50 | 48 | "sphinx.ext.viewcode", |
51 | 49 | "sphinx_rtd_theme", |
52 | | - "recommonmark", |
| 50 | + "myst_parser", |
53 | 51 | ] |
54 | 52 |
|
55 | 53 | autodoc_typehints = 'description' |
|
59 | 57 |
|
60 | 58 | # Prefix each autosectionlabel with the name of the document it is in and a colon |
61 | 59 | autosectionlabel_prefix_document = True |
| 60 | +myst_heading_anchors = 2 |
62 | 61 |
|
63 | 62 | # Add any paths that contain templates here, relative to this directory. |
64 | 63 | templates_path = ['_templates'] |
|
197 | 196 | # Customize the html_theme |
198 | 197 | html_theme_options = {'navigation_depth': 3} |
199 | 198 |
|
200 | | -# Use m2r only for mdinclude and recommonmark for everything else |
201 | | -# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992 |
202 | 199 | def setup(app): |
203 | | - config = { |
204 | | - # 'url_resolver': lambda url: github_doc_root + url, |
205 | | - 'auto_toc_tree_section': 'Contents', |
206 | | - 'enable_eval_rst': True, |
207 | | - } |
208 | | - app.add_config_value('recommonmark_config', config, True) |
209 | | - app.add_transform(AutoStructify) |
210 | | - |
211 | | - # from m2r to make `mdinclude` work |
212 | | - app.add_config_value('no_underscore_emphasis', False, 'env') |
213 | | - app.add_config_value('m2r_parse_relative_links', False, 'env') |
214 | | - app.add_config_value('m2r_anonymous_references', False, 'env') |
215 | | - app.add_config_value('m2r_disable_inline_math', False, 'env') |
216 | | - app.add_directive('mdinclude', MdInclude) |
| 200 | + |
217 | 201 | app.add_css_file('custom.css') |
218 | 202 |
|
219 | 203 | # generate the components.rst file dynamically so it points to stable/latest |
|
0 commit comments