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

Skip to content

Commit 052583d

Browse files
committed
DOC: Switch to napoleon instead of numpydoc.
1 parent 1d89de2 commit 052583d

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

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: 7 additions & 3 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

@@ -328,5 +332,5 @@ def getapi(*args):
328332
sys.modules['sip'] = mocksip
329333
sys.modules['PyQt4'] = mockpyqt4
330334

331-
################# numpydoc config ####################
332-
numpydoc_show_class_members = False
335+
################# napoleon config ####################
336+
napoleon_google_docstring = 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)