aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Documentation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-02-23 16:00:54 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-05-21 02:45:14 +0200
commit6f8d77f7855833370228f75cb2a05dfbc651566f (patch)
tree88da945497d64736a0213817b36565fe7468a610 /Documentation
parent1b1d5ed1b17ed00d89db617b2c7f2cd41eee9c50 (diff)
downloadsparse-dev-6f8d77f7855833370228f75cb2a05dfbc651566f.tar.gz
doc: allow .md with py3-sphinx
The current support for markdown source files is fine for py2-sphinx but not for py3. Fix it by checking python's version and add the reference to the mardown parser module accordingly. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/conf.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 86f1dc47..abd496db 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -31,9 +31,16 @@ import datetime
extensions = [
]
-source_parsers = {
- '.md': 'recommonmark.parser.CommonMarkParser',
-}
+# support .md with python2 & python3
+if sys.version_info[0] > 2:
+ from recommonmark.parser import CommonMarkParser
+ source_parsers = {
+ '.md': CommonMarkParser,
+ }
+else:
+ source_parsers = {
+ '.md': 'recommonmark.parser.CommonMarkParser',
+ }
# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates']