Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e4fc86f

Browse files
committed
Merge pull request matplotlib#2656 from mdboom/use-ipython-console-highlighting-if-available
Use IPython's copy of ipython_console_highlighting Sphinx ext, if available
2 parents 45ee98c + 5b744a9 commit e4fc86f

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
@@ -30,10 +30,17 @@
3030
'sphinx.ext.doctest', 'sphinx.ext.autosummary',
3131
'matplotlib.sphinxext.plot_directive', 'sphinx.ext.inheritance_diagram',
3232
'sphinxext.gen_gallery', 'sphinxext.gen_rst',
33-
'matplotlib.sphinxext.ipython_console_highlighting',
3433
'sphinxext.github',
3534
'numpydoc']
3635

36+
# Use IPython's console highlighting by default
37+
try:
38+
from IPython.sphinxext import ipython_console_highlighting
39+
except ImportError:
40+
extensions.append('matplotlib.sphinxext.ipython_console_highlighting')
41+
else:
42+
print("Using IPython's ipython_console_highlighting directive")
43+
extensions.append('IPython.sphinxext.ipython_console_highlighting')
3744

3845
try:
3946
import numpydoc

0 commit comments

Comments
 (0)