diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-06-27 15:02:14 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-06-27 15:02:14 +0000 |
commit | 692f3f65acd441995f893908d694b3891a67070c (patch) | |
tree | eaf7c6fe5d1b3ab13525eb7f85fd598db67cce6a /doc/source | |
parent | cefd431502c6b9915611ca46cd8194b7007db0ef (diff) | |
download | numpy-692f3f65acd441995f893908d694b3891a67070c.tar.gz |
docs: generate Attributes and Methods sections in class documentation
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/_templates/autosummary/class.rst | 23 | ||||
-rw-r--r-- | doc/source/conf.py | 8 |
2 files changed, 29 insertions, 2 deletions
diff --git a/doc/source/_templates/autosummary/class.rst b/doc/source/_templates/autosummary/class.rst new file mode 100644 index 000000000..15af9822e --- /dev/null +++ b/doc/source/_templates/autosummary/class.rst @@ -0,0 +1,23 @@ +{% extends "!autosummary/class.rst" %} + +{% block methods %} +{% if methods %} + .. HACK + .. autosummary:: + :toctree: + {% for item in methods %} + ~{{ name }}.{{ item }} + {%- endfor %} +{% endif %} +{% endblock %} + +{% block attributes %} +{% if attributes %} + .. HACK + .. autosummary:: + :toctree: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} +{% endif %} +{% endblock %} diff --git a/doc/source/conf.py b/doc/source/conf.py index 318011e8a..1fbd0c60e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -18,12 +18,13 @@ sys.path.insert(0, os.path.abspath('../sphinxext')) extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'numpydoc', 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', - 'only_directives', 'plot_directive'] + 'plot_directive'] if sphinx.__version__ >= "0.7": extensions.append('sphinx.ext.autosummary') else: extensions.append('autosummary') + extensions.append('only_directives') # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -250,6 +251,9 @@ np.random.seed(0) plot_include_source = True plot_formats = [('png', 100), 'pdf'] +import math +phi = (math.sqrt(5) + 1)/2 + import matplotlib matplotlib.rcParams.update({ 'font.size': 8, @@ -258,7 +262,7 @@ matplotlib.rcParams.update({ 'xtick.labelsize': 8, 'ytick.labelsize': 8, 'legend.fontsize': 8, - 'figure.figsize': (3.236068, 2), + 'figure.figsize': (3*phi, 3), 'figure.subplot.bottom': 0.2, 'figure.subplot.left': 0.2, 'figure.subplot.right': 0.9, |