Skip to content

Instantly share code, notes, and snippets.

@deadbits
Created February 16, 2015 21:13
Show Gist options
  • Save deadbits/46cce3b0ca89156fe0cc to your computer and use it in GitHub Desktop.
Save deadbits/46cce3b0ca89156fe0cc to your computer and use it in GitHub Desktop.
documentation format
Functions and Methods (function or method docstrings)
@param p: ... A description of the parameter p for a function or method. It may appear in the class docstring to describe a costructor parameter: mostly useful for C extensions.
@type p: ... The expected type for the parameter. p.
@return: ... The return value for a function or method.
@rtype: ... The type of the return value for a function or method.
@keyword p: ... A description of the keyword parameter p. It may appear in the class docstring to describe a costructor keyword parameter.
@raise e: ... A description of the circumstances under which a function or method raises exception e. It may appear in the class docstring to describe an exception that can be raised by the costructor.
Variables (module, class or variable docstrings)
@ivar v: ... A description of the class instance variable v.
@cvar v: ... A description of the static class variable v.
@var v: ... A description of the module variable v.
@type v: ... The type of the variable v.
Properties (property docstrings)
@type: ... The type of the property.
Grouping and Sorting (module, class, function, or method docstrings)
@group g: c1,...,cn Organizes a set of related children of a module or class into a group. g is the name of the group; and c1,...,cn are the names of the children in the group. To define multiple groups, use multiple group fields.
@sort: c1,...,cn Specifies the sort order for the children of a module or class. c1,...,cn are the names of the children, in the order in which they should appear. Any children that are not included in this list will appear after the children from this list, in alphabetical order.
Related Topics
@see: ... A description of a related topic. see fields typically use documentation crossreference links or external hyperlinks that link to the related topic.
Notes and Warnings
@note: ... A note about an object. Multiple note fields may be used to list separate notes.
@attention: ... An important note about an object. Multiple attention fields may be used to list separate notes.
@bug: ... A description of a bug in an object. Multiple bug fields may be used to report separate bugs.
@warning: ... A warning about an object. Multiple warning fields may be used to report separate warnings.
Status
@version: ... The current version of an object.
@todo [ver]: ... A planned change to an object. If the optional argument ver is given, then it specifies the version for which the change will be made. Multiple todo fields may be used if multiple changes are planned.
@deprecated: ... Indicates that an object is deprecated. The body of the field describe the reason why the object is deprecated.
@since: ... The date or version when an object was first introduced.
@status: ... The current status of an object.
@change: ... A change log entry for this object.
@permission: ... The object access permission, for systems such Zope/Plone supporting this concept. It may be used more than once to specify multiple permissions.
Formal Conditions
@requires: ... A requirement for using an object. Multiple requires fields may be used if an object has multiple requirements.
@precondition: ... A condition that must be true before an object is used. Multiple precondition fields may be used if an object has multiple preconditions.
@postcondition: ... A condition that is guaranteed to be true after an object is used. Multiple postcondition fields may be used if an object has multiple postconditions.
@invariant: ... A condition which should always be true for an object. Multiple invariant fields may be used if an object has multiple invariants.
Bibliographic Information
@author: ... The author(s) of an object. Multiple author fields may be used if an object has multiple authors.
@organization: ... The organization that created or maintains an object.
@copyright: ... The copyright information for an object.
@license: ... The licensing information for an object.
@contact: ... Contact information for the author or maintainer of a module, class, function, or method. Multiple contact fields may be used if an object has multiple contacts.
Summarization
@summary: ... A summary description for an object. This description overrides the default summary (which is constructed from the first sentence of the object's description).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment