Skip to content

Commit 63e6113

Browse files
committed
upgrade to m2r2 and sphinx patch
1 parent 61c64bf commit 63e6113

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

docs/conf.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,29 @@
99
import os
1010
import inspect
1111
import importlib
12+
import m2r2
1213

1314
import sphinx_compas_theme
1415
from sphinx.ext.napoleon.docstring import NumpyDocstring
1516

1617
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../src'))
1718

19+
# patches
20+
21+
current_m2r2_setup = m2r2.setup
22+
23+
def patched_m2r2_setup(app):
24+
try:
25+
return current_m2r2_setup(app)
26+
except (AttributeError):
27+
app.add_source_suffix(".md", "markdown")
28+
app.add_source_parser(m2r2.M2RParser)
29+
return dict(
30+
version=m2r2.__version__, parallel_read_safe=True, parallel_write_safe=True,
31+
)
32+
33+
m2r2.setup = patched_m2r2_setup
34+
1835
# -- General configuration ------------------------------------------------
1936

2037
project = "COMPAS"

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ invoke >=0.14
99
ipykernel
1010
ipython >=5.8
1111
isort
12-
m2r
12+
m2r2
1313
nbsphinx
1414
pydocstyle
1515
pytest >=3.2

0 commit comments

Comments
 (0)