99# All configuration values have a default; values that are commented out
1010# serve to show the default.
1111
12- import sys , os
1312from datetime import date
14- from recommonmark .parser import CommonMarkParser
15-
1613# If extensions (or modules to document with autodoc) are in another directory,
1714# add these directories to sys.path here. If the directory is relative to the
1815# documentation root, use os.path.abspath to make it absolute, like shown here.
1916# sys.path.insert(0, os.path.abspath('.'))
2017
2118# -- General configuration -----------------------------------------------------
2219
23- # https://github.com/readthedocs/recommonmark/issues/177
24- # Method used to remove the warning message.
25- class CustomCommonMarkParser (CommonMarkParser ):
26- def visit_document (self , node ):
27- pass
28-
29-
3020# If your documentation needs a minimal Sphinx version, state it here.
3121# needs_sphinx = '1.0'
3222# Add any Sphinx extension module names here, as strings. They can be extensions
@@ -36,49 +26,11 @@ def visit_document(self, node):
3626# Add any paths that contain templates here, relative to this directory.
3727templates_path = ["_templates" ]
3828
39- # The suffix of source filenames.
40- source_suffix = {
41- ".rst" : "restructuredtext" ,
42- }
43- try :
44- import recommonmark
45- except ImportError :
46- # manpages do not use any .md sources
47- if not tags .has ("builder-man" ):
48- raise
49- else :
50- import sphinx
51-
52- if sphinx .version_info >= (3 , 0 ):
53- # This requires 0.5 or later.
54- extensions .append ("recommonmark" )
55- else :
56- source_parsers = {".md" : CustomCommonMarkParser }
57- source_suffix [".md" ] = "markdown"
58- extensions .append ("sphinx_markdown_tables" )
59-
60- # Setup AutoStructify for inline .rst toctrees in index.md
61- from recommonmark .transform import AutoStructify
62-
63- # Stolen from https://github.com/readthedocs/recommonmark/issues/93
64- # Monkey patch to fix recommonmark 0.4 doc reference issues.
65- from recommonmark .states import DummyStateMachine
66-
67- orig_run_role = DummyStateMachine .run_role
68-
69- def run_role (self , name , options = None , content = None ):
70- if name == "doc" :
71- name = "any"
72- return orig_run_role (self , name , options , content )
73-
74- DummyStateMachine .run_role = run_role
75-
76- def setup (app ):
77- # Disable inline math to avoid
78- # https://github.com/readthedocs/recommonmark/issues/120 in Extensions.md
79- app .add_config_value ("recommonmark_config" , {"enable_inline_math" : False }, True )
80- app .add_transform (AutoStructify )
29+ import sphinx
8130
31+ if sphinx .version_info >= (3 , 0 ):
32+ extensions .append ("myst_parser" )
33+ extensions .append ("sphinx_markdown_tables" )
8234
8335# The encoding of source files.
8436# source_encoding = 'utf-8-sig'
0 commit comments