summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2011-03-25 12:02:44 +0100
committerRalf Gommers <ralf.gommers@googlemail.com>2011-03-29 16:23:34 +0200
commitb11ae17a3e3e0ef1861e95ea67b00ecb838804e5 (patch)
tree5c955829d80b79772d44e5ff8454d2c9413eecc3 /doc
parent99fc1281d0401b2284aeb69359c6b2ed739ade7d (diff)
downloadnumpy-b11ae17a3e3e0ef1861e95ea67b00ecb838804e5.tar.gz
DOC: add description of how to document modules to the doc standard.
Closes #1280.
Diffstat (limited to 'doc')
-rw-r--r--doc/HOWTO_DOCUMENT.rst.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/HOWTO_DOCUMENT.rst.txt b/doc/HOWTO_DOCUMENT.rst.txt
index bbd9531e8..87f4de816 100644
--- a/doc/HOWTO_DOCUMENT.rst.txt
+++ b/doc/HOWTO_DOCUMENT.rst.txt
@@ -424,6 +424,7 @@ Method docstrings
Document these as you would any other function. Do not include
``self`` in the list of parameters.
+
Documenting class instances
---------------------------
Instances of classes that are part of the Numpy API (for example `np.r_`
@@ -438,6 +439,7 @@ instances a useful docstring, we do the following:
``__doc__`` attributes at run time. The class is documented as usual, and
the exposed instances can be mentioned in the Notes and See Also sections.
+
Documenting constants
---------------------
Use the same sections as outlined for functions where applicable::
@@ -453,6 +455,29 @@ Docstrings for constants will not be visible in text terminals
to them like for for class instances), but will appear in the
documentation built with Sphinx.
+
+Documenting modules
+-------------------
+Each module should have a docstring with at least a summary line. Other
+sections are optional, and should be used in the same order as for documenting
+functions when they are appropriate::
+
+ 1. summary
+ 2. extended summary
+ 3. routine listings
+ 4. see also
+ 5. notes
+ 6. references
+ 7. examples
+
+Routine listings are encouraged, especially for large modules, for which it is
+hard to get a good overview of all functionality provided by looking at the
+source file(s) or the __all__ dict.
+
+Note that license and author info, while often included in source files, do not
+belong in docstrings.
+
+
Other points to keep in mind
----------------------------
* Notes and Warnings : If there are points in the docstring that deserve