|
13 | 13 |
|
14 | 14 | import sys, os |
15 | 15 |
|
16 | | -# If your extensions are in another directory, add it here. If the directory |
17 | | -# is relative to the documentation root, use os.path.abspath to make it |
18 | | -# absolute, like shown here. |
19 | | -sys.path.append(os.path.abspath('../sphinxext')) |
| 16 | +# Check Sphinx version |
| 17 | +import sphinx |
| 18 | +if sphinx.__version__ < "0.5": |
| 19 | + raise RuntimeError("Sphinx 0.5.dev or newer required") |
20 | 20 |
|
21 | 21 | # General configuration |
22 | 22 | # --------------------- |
23 | 23 |
|
24 | 24 | # Add any Sphinx extension module names here, as strings. They can be extensions |
25 | 25 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
26 | | -extensions = ['sphinx.ext.pngmath', 'sphinx.ext.autodoc', |
27 | | - 'ipython_console_highlighting', 'plot_directive', 'numpydoc', |
28 | | - 'docscrape', 'docscrape_sphinx', 'autosummary'] |
| 26 | + |
| 27 | +sys.path.append(os.path.abspath('../sphinxext')) |
| 28 | + |
| 29 | +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'numpydoc', |
| 30 | + 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', |
| 31 | + 'only_directives'] |
| 32 | + |
| 33 | +if sphinx.__version__ >= "0.7": |
| 34 | + extensions.append('sphinx.ext.autosummary') |
| 35 | + import glob |
| 36 | + autosummary_generate = glob.glob("reference/*.rst") |
| 37 | +else: |
| 38 | + extensions.append('autosummary') |
29 | 39 |
|
30 | 40 | # Add any paths that contain templates here, relative to this directory. |
31 | 41 | templates_path = ['_templates'] |
|
0 commit comments