8000 Use IPython's copy of ipython_console_highlighting if it is available. · matplotlib/matplotlib@5b744a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b744a9

Browse files
committed
Use IPython's copy of ipython_console_highlighting if it is available.
1 parent a0bb747 commit 5b744a9

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)
0