summaryrefslogtreecommitdiffstats
path: root/Doc/documenting/markup.rst
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-04-20 17:24:09 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-04-20 17:24:09 (GMT)
commit37e6c54ba122703a0162dd44cf3eac78c46c8bdd (patch)
tree1453d6434ce4859948c382ae46cd12034e46fc8a /Doc/documenting/markup.rst
parent6f205ed37eb4b785b60081f957d515ca16b0db47 (diff)
parent5c1a0c969d82670ba7aac7647b9828f4df85c1bd (diff)
downloadcpython-37e6c54ba122703a0162dd44cf3eac78c46c8bdd.zip
cpython-37e6c54ba122703a0162dd44cf3eac78c46c8bdd.tar.gz
cpython-37e6c54ba122703a0162dd44cf3eac78c46c8bdd.tar.bz2
Merge 3.1
Diffstat (limited to 'Doc/documenting/markup.rst')
-rw-r--r--Doc/documenting/markup.rst25
1 files changed, 21 insertions, 4 deletions
diff --git a/Doc/documenting/markup.rst b/Doc/documenting/markup.rst
index 277ca9f..1f5b1e3 100644
--- a/Doc/documenting/markup.rst
+++ b/Doc/documenting/markup.rst
@@ -152,7 +152,7 @@ The directives are:
Describes global data in a module, including both variables and values used
as "defined constants." Class and object attributes are not documented
- using this environment.
+ using this directive.
.. describe:: exception
@@ -165,7 +165,7 @@ The directives are:
parameters, enclosing optional parameters in brackets. Default values can be
given if it enhances clarity. For example::
- .. function:: Timer.repeat([repeat=3[, number=1000000]])
+ .. function:: repeat([repeat=3[, number=1000000]])
Object methods are not documented using this directive. Bound object methods
placed in the module namespace as part of the public interface of the module
@@ -217,13 +217,30 @@ The directives are:
Describes an object data attribute. The description should include
information about the type of the data to be expected and whether it may be
- changed directly.
+ changed directly. This directive should be nested in a class directive,
+ like in this example::
+
+ .. class:: Spam
+
+ Description of the class.
+
+ .. data:: ham
+
+ Description of the attribute.
+
+ If is also possible to document an attribute outside of a class directive,
+ for example if the documentation for different attributes and methods is
+ split in multiple sections. The class name should then be included
+ explicitly::
+
+ .. data:: Spam.eggs
.. describe:: method
Describes an object method. The parameters should not include the ``self``
parameter. The description should include similar information to that
- described for ``function``.
+ described for ``function``. This method should be nested in a class
+ method, like in the example above.
.. describe:: decoratormethod