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

Skip to content

Commit c7042ad

Browse files
committed
DOC: Switch to napoleon instead of numpydoc.
1 parent 6db787f commit c7042ad

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ install:
100100
# Neihter is installed as a dependency of IPython since they are not used by the IPython console.
101101
- |
102102
if [[ $BUILD_DOCS == true ]]; then
103-
pip install $PRE numpydoc ipython jsonschema mistune colorspacious
103+
pip install $PRE ipython jsonschema mistune colorspacious
104104
pip install -q $PRE linkchecker
105105
wget https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O Felipa-Regular.ttf
106106
wget http://mirrors.kernel.org/ubuntu/pool/universe/f/fonts-humor-sans/fonts-humor-sans_1.0-1_all.deb

doc/README.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ python documentation system built on top of ReST. This directory contains
3333
* mpl_examples - a link to the matplotlib examples in case any
3434
documentation wants to literal include them
3535

36-
To build the HTML documentation, install sphinx (1.0 or greater
37-
required), then type "python make.py html" in this directory. Wait
38-
for the initial run (which builds the example gallery) to be done,
39-
then run "python make.py html" again. The top file of the results will
40-
be ./build/html/index.html
36+
To build the HTML documentation, install sphinx (1.0 or greater required) and,
37+
if sphinx older than 1.3, sphinxcontrib-napoleon, then type "python make.py
38+
html" in this directory. The top file of the results will be
39+
./build/html/index.html
4140

4241
Note that Sphinx uses the installed version of the package to build
4342
the documentation, so matplotlib must be installed *before* the docs

doc/conf.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
'sphinx.ext.inheritance_diagram',
3333
'sphinxext.gen_gallery', 'sphinxext.gen_rst',
3434
'sphinxext.github',
35-
'numpydoc']
35+
]
36+
if hasattr(sphinx, 'version_info') and sphinx.version_info[:2] >= (1, 3):
37+
extensions += ['sphinx.ext.napoleon']
38+
else:
39+
extensions += ['sphinxcontrib.napoleon']
3640

3741
exclude_patterns = ['api/api_changes/*', 'users/whats_new/*']
3842

@@ -46,12 +50,6 @@
4650
extensions.append('IPython.sphinxext.ipython_console_highlighting')
4751
extensions.append('IPython.sphinxext.ipython_directive')
4852

49-
try:
50-
import numpydoc
51-
except ImportError:
52-
raise ImportError("No module named numpydoc - you need to install "
53-
"numpydoc to build the documentation.")
54-
5553

5654
autosummary_generate = True
5755

@@ -333,5 +331,6 @@ def getapi(*args):
333331
sys.modules['sip'] = mocksip
334332
sys.modules['PyQt4'] = mockpyqt4
335333

336-
################# numpydoc config ####################
337-
numpydoc_show_class_members = False
334+
################# napoleon config ####################
335+
napoleon_google_docstring = False
336+
napoleon_use_param = False

doc/make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def htmlhelp():
6060
with open('build/htmlhelp/index.html', 'r+') as fh:
6161
content = fh.read()
6262
fh.seek(0)
63-
content = re.sub(r'<script>.*?</script>', '', content,
63+
content = re.sub(r'<script>.*?</script>', '', content,
6464
flags=re.MULTILINE| re.DOTALL)
6565
fh.write(content)
6666
fh.truncate()

0 commit comments

Comments
 (0)