Skip to content

Commit ac1f099

Browse files
authored
MAINT/DOC: pngmath deprecated for sphinx >= 1.4
ported from scikit-learn/scikit-learn#7279
1 parent 7cfc247 commit ac1f099

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

doc/conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,20 @@
4343
'sphinx.ext.intersphinx',
4444
'sphinx.ext.todo',
4545
'numpydoc',
46-
'sphinx.ext.pngmath',
4746
'sphinx.ext.ifconfig',
4847
'sphinx.ext.viewcode',
4948
'sphinx_gallery.gen_gallery'
5049

5150
]
5251

52+
# pngmath / imgmath compatibility layer for different sphinx versions
53+
import sphinx
54+
from distutils.version import LooseVersion
55+
if LooseVersion(sphinx.__version__) < LooseVersion('1.4'):
56+
extensions.append('sphinx.ext.pngmath')
57+
else:
58+
extensions.append('sphinx.ext.imgmath')
59+
5360
sphinx_gallery_conf = {
5461
# path to your examples scripts
5562
'examples_dirs' : '../examples',

0 commit comments

Comments
 (0)