Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e4fc86f

Browse filesBrowse files
committed
Merge pull request #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
Copy full SHA for e4fc86f

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed

‎doc/conf.py

Copy file name to clipboardExpand all lines: doc/conf.py
+8-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.