mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-17 11:32:45 +08:00
Use plot_directive from matplotlib.sphinxext if available
This commit is contained in:
+18
-1
@@ -26,9 +26,26 @@ sys.path.append(os.path.join(curpath, '..', 'ext'))
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'numpydoc',
|
||||
'sphinx.ext.autosummary', 'plot_directive', 'plot2rst',
|
||||
'sphinx.ext.autosummary', 'plot2rst',
|
||||
'sphinx.ext.intersphinx']
|
||||
|
||||
# Determine if the matplotlib has a recent enough version of the
|
||||
# plot_directive, otherwise use the local fork.
|
||||
try:
|
||||
from matplotlib.sphinxext import plot_directive
|
||||
except ImportError:
|
||||
use_matplotlib_plot_directive = False
|
||||
else:
|
||||
try:
|
||||
use_matplotlib_plot_directive = (plot_directive.__version__ >= 2)
|
||||
except AttributeError:
|
||||
use_matplotlib_plot_directive = False
|
||||
|
||||
if use_matplotlib_plot_directive:
|
||||
extensions.append('matplotlib.sphinxext.plot_directive')
|
||||
else:
|
||||
extensions.append('plot_directive')
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user