3.2. sphinx.ext.autodoc¶
Automatically insert docstrings for functions, classes or whole modules into the doctree, thus avoiding duplication between docstrings and documentation for those who like elaborate docstrings.
| copyright: | Copyright 2007-2016 by the Sphinx team, see AUTHORS. |
|---|---|
| license: | BSD, see LICENSE for details. |
3.2.1. Functions¶
add_documenter(cls) |
Register a new Documenter. |
annotation_option(arg) |
|
assemble_option_dict(option_list, options_spec) |
Return a mapping of option names to values. |
between(marker[, what, keepempty, exclude]) |
Return a listener that either keeps, or if exclude is True excludes, lines between lines that match the marker regular expression. |
bool_option(arg) |
Used to convert flag options to auto directives. |
cut_lines(pre[, post, what]) |
Return a listener that removes the first pre and last post lines of every docstring. |
force_decode(string, encoding) |
Forcibly get a unicode string out of a bytestring. |
formatargspec(*argspec) |
|
getargspec(func) |
Like inspect.getargspec but supports functools.partial as well. |
identity(x) |
|
is_builtin_class_method(obj, attr_name) |
If attr_name is implemented at builtin class, return True. |
isdescriptor(x) |
Check if the object is some kind of descriptor. |
iteritems(d, **kw) |
Return an iterator over the (key, value) pairs of a dictionary. |
itervalues(d, **kw) |
Return an iterator over the values of a dictionary. |
members_option(arg) |
Used to convert the :members: option to auto directives. |
members_set_option(arg) |
Used to convert the :members: option to auto directives. |
mock_import(modname) |
|
nested_parse_with_titles(state, content, node) |
Version of state.nested_parse() that allows titles and does not require titles to have the same decoration as the calling document. |
object_description(object) |
A repr() implementation that returns text safe to use in reST context. |
prepare_docstring(s[, ignore]) |
Convert a docstring into lines of parseable reST. |
rpartition(s, t) |
Similar to str.rpartition from 2.5, but doesn’t return the separator. |
safe_getattr(obj, name, *defargs) |
A getattr() that turns all exceptions into AttributeErrors. |
safe_getmembers(object[, predicate, attr_getter]) |
A version of inspect.getmembers() that uses safe_getattr(). |
setup(app) |
3.2.2. Classes¶
AttributeDocumenter(directive, name[, indent]) |
Specialized Documenter subclass for attributes. |
AutoDirective(name, arguments, options, ...) |
The AutoDirective class is used for all autodoc directives. |
AutodocReporter(viewlist, reporter) |
A reporter replacement that assigns the correct source name and line number to a system message, as recorded in a ViewList. |
BuiltinFunctionType |
alias of builtin_function_or_method |
ClassDocumenter(directive, name[, indent]) |
Specialized Documenter subclass for classes. |
ClassLevelDocumenter(directive, name[, indent]) |
Specialized Documenter subclass for objects on class level (methods, attributes). |
DataDocumenter(directive, name[, indent]) |
Specialized Documenter subclass for data items. |
DefDict(default) |
A dict that returns a default on nonexisting keys. |
Directive(name, arguments, options, content, ...) |
Base class for reStructuredText directives. |
DocstringSignatureMixin |
Mixin for FunctionDocumenter and MethodDocumenter to provide the feature of reading the signature from the docstring. |
DocstringStripSignatureMixin |
Mixin for AttributeDocumenter to provide the feature of stripping any function signature from the docstring. |
Documenter(directive, name[, indent]) |
A Documenter knows how to autodocument a single object type. |
ExceptionDocumenter(directive, name[, indent]) |
Specialized ClassDocumenter subclass for exceptions. |
FunctionDocumenter(directive, name[, indent]) |
Specialized Documenter subclass for functions. |
FunctionType |
alias of function |
InstanceAttributeDocumenter(directive, name) |
Specialized Documenter subclass for attributes that cannot be imported because they are instance attributes (e.g. |
MethodDocumenter(directive, name[, indent]) |
Specialized Documenter subclass for methods (normal, static and class). |
MethodType |
alias of instancemethod |
ModuleAnalyzer(source, modname, srcname[, ...]) |
|
ModuleDocumenter(directive, name[, indent]) |
Specialized Documenter subclass for modules. |
ModuleLevelDocumenter(directive, name[, indent]) |
Specialized Documenter subclass for objects on module level (functions, classes, data/constants). |
Options |
A dict/attribute hybrid that returns None on nonexisting keys. |
ViewList([initlist, source, items, parent, ...]) |
List with extended functionality: slices of ViewList objects are child lists, linked to their parents. |
testcls |
test doc string |
text_type |
alias of unicode |
3.2.3. Exceptions¶
ExtensionError(message[, orig_exc]) |
Raised if something’s wrong with the configuration. |
PycodeError |