summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-06 00:28:29 +0100
committerGeorg Brandl <georg@python.org>2009-01-06 00:28:29 +0100
commitcb999405797a73ccf02eed249bfe628b3f305699 (patch)
treeef4c413ef791dd1b6c1d6c96733546d2f7b48968
parent5c28c0bd44c42ddd7e01150d363a0ca0bdcf6b83 (diff)
downloadsphinx-cb999405797a73ccf02eed249bfe628b3f305699.tar.gz
Document how autodoc with attributes works.
-rw-r--r--doc/ext/autodoc.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/ext/autodoc.rst b/doc/ext/autodoc.rst
index 993f971a..e0766938 100644
--- a/doc/ext/autodoc.rst
+++ b/doc/ext/autodoc.rst
@@ -135,12 +135,30 @@ directive.
.. directive:: autofunction
+ autodata
automethod
autoattribute
These work exactly like :dir:`autoclass` etc., but do not offer the options
used for automatic member documentation.
+ For module data members and class attributes, documentation can either be put
+ into a special-formatted comment *before* the attribute definition, or in a
+ docstring *after* the definition. This means that in the following class
+ definition, both attributes can be autodocumented::
+
+ class Foo:
+ """Docstring for class Foo."""
+
+ #: Doc comment for attribute Foo.bar.
+ bar = 1
+
+ baz = 2
+ """Docstring for attribute Foo.baz."""
+
+ .. versionchanged:: 0.6
+ :dir:`autodata` and :dir:`autoattribute` can now extract docstrings.
+
.. note::
If you document decorated functions or methods, keep in mind that autodoc