class Documenter: (source)
Known subclasses: sphinx.ext.autodoc.ClassLevelDocumenter
, sphinx.ext.autodoc.ModuleDocumenter
, sphinx.ext.autodoc.ModuleLevelDocumenter
A Documenter knows how to autodocument a single object type. When registered with the AutoDirective, it will be used to document objects of that type when needed by autodoc. Its *objtype* attribute selects what auto directive it is assigned to (the directive name is 'auto' + objtype), and what directive it generates by default, though that can be overridden by an attribute called *directivetype*. A Documenter has an *option_spec* that works like a docutils directive's; in fact, it will be used to parse an auto directive's options that matches the Documenter.
Class Method | can |
Called to see if a member can be documented by this Documenter. |
Method | __init__ |
Undocumented |
Method | add |
Add content from docstrings, attribute documentation and user. |
Method | add |
Add the directive header and options to the generated content. |
Method | add |
Append one line of generated reST to the output. |
Method | check |
Check if *self.object* is really defined in the module given by *self.modname*. |
Method | document |
Generate reST for member documentation. |
Method | filter |
Filter the given member list. |
Method | format |
Format the argument signature of *self.object*. |
Method | format |
Format the name of *self.object*. |
Method | format |
Format the signature (arguments and return annotation) of the object. |
Method | generate |
Generate reST for the object given by *self.name*, and possibly for its members. |
Method | get |
getattr() override for types such as Zope interfaces. |
Method | get |
Decode and return lines of the docstring(s) for the object. |
Method | get |
Return `(members_check_module, members)` where `members` is a list of `(membername, member)` pairs of the members of *self.object*. |
Method | get |
Get the real module name of an object to document. |
Method | get |
Undocumented |
Method | import |
Import the object given by *self.modname* and *self.objpath* and set it as *self.object*. |
Method | parse |
Determine what module to import and what attribute to document. |
Method | process |
Let the user process the docstrings before adding them. |
Method | resolve |
Resolve the module and name of the object to document given by the arguments and the current module/class. |
Method | sort |
Sort the given member list. |
Class Variable | content |
Undocumented |
Class Variable | member |
Undocumented |
Class Variable | objtype |
Undocumented |
Class Variable | option |
Undocumented |
Class Variable | priority |
Undocumented |
Class Variable | titles |
Undocumented |
Instance Variable | analyzer |
Undocumented |
Instance Variable | args |
Undocumented |
Instance Variable | config |
Undocumented |
Instance Variable | directive |
Undocumented |
Instance Variable | env |
Undocumented |
Instance Variable | fullname |
Undocumented |
Instance Variable | indent |
Undocumented |
Instance Variable | modname |
Undocumented |
Instance Variable | module |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | object |
Undocumented |
Instance Variable | object |
Undocumented |
Instance Variable | objpath |
Undocumented |
Instance Variable | options |
Undocumented |
Instance Variable | parent |
Undocumented |
Instance Variable | real |
Undocumented |
Instance Variable | retann |
Undocumented |
Property | documenters |
Returns registered Documenter classes |
Method | _call |
Undocumented |
Undocumented
Parameters | |
directive:DocumenterBridge | Undocumented |
name:str | Undocumented |
indent:str | Undocumented |
sphinx.ext.autodoc.AttributeDocumenter
, sphinx.ext.autodoc.ClassDocumenter
, sphinx.ext.autodoc.DataDocumenter
, sphinx.ext.autodoc.ModuleDocumenter
Add content from docstrings, attribute documentation and user.
Parameters | |
moreStringList|None | Undocumented |
sphinx.ext.autodoc.AttributeDocumenter
, sphinx.ext.autodoc.ClassDocumenter
, sphinx.ext.autodoc.DataDocumenter
, sphinx.ext.autodoc.FunctionDocumenter
, sphinx.ext.autodoc.MethodDocumenter
, sphinx.ext.autodoc.ModuleDocumenter
, sphinx.ext.autodoc.PropertyDocumenter
Add the directive header and options to the generated content.
Parameters | |
sig:str | Undocumented |
Check if *self.object* is really defined in the module given by *self.modname*.
Returns | |
bool | Undocumented |
sphinx.ext.autodoc.AttributeDocumenter
, sphinx.ext.autodoc.ClassDocumenter
, sphinx.ext.autodoc.DataDocumenter
, sphinx.ext.autodoc.FunctionDocumenter
, sphinx.ext.autodoc.MethodDocumenter
, sphinx.ext.autodoc.PropertyDocumenter
Generate reST for member documentation. If *all_members* is True, document all members, else those given by *self.options.members*.
Parameters | |
allbool | Undocumented |
Filter the given member list. Members are skipped if - they are private (except if given explicitly or the private-members option is set) - they are special methods (except if given explicitly or the special-members option is set) - they are undocumented (except if the undoc-members option is set) The user can override the skipping decision by connecting to the ``autodoc-skip-member`` event.
Parameters | |
members:ObjectMembers | Undocumented |
wantbool | Undocumented |
Returns | |
list[ | Undocumented |
Format the name of *self.object*. This normally should be something that can be parsed by the generated directive, but doesn't need to be (Sphinx will display it unparsed then).
Returns | |
str | Undocumented |
sphinx.ext.autodoc.ClassDocumenter
Generate reST for the object given by *self.name*, and possibly for its members. If *more_content* is given, include that content. If *real_modname* is given, use that module name to find attribute docs. If *check_module* is True, only generate if the object is defined in the module name it is imported from. If *all_members* is True, document all members.
Parameters | |
moreStringList|None | Undocumented |
realstr|None | Undocumented |
checkbool | Undocumented |
allbool | Undocumented |
Return `(members_check_module, members)` where `members` is a list of `(membername, member)` pairs of the members of *self.object*. If *want_all* is True, return all members. Else, only return those members given by *self.options.members* (which may also be None).
Parameters | |
wantbool | Undocumented |
Returns | |
tuple[ | Undocumented |
sphinx.ext.autodoc.AttributeDocumenter
, sphinx.ext.autodoc.DataDocumenter
, sphinx.ext.autodoc.PropertyDocumenter
Get the real module name of an object to document. It can differ from the name of the module through which the object was imported.
Returns | |
str | Undocumented |
sphinx.ext.autodoc.ModuleDocumenter
Determine what module to import and what attribute to document. Returns True and sets *self.modname*, *self.objpath*, *self.fullname*, *self.args* and *self.retann* if parsing and resolving was successful.
Returns | |
bool | Undocumented |
sphinx.ext.autodoc.ClassLevelDocumenter
, sphinx.ext.autodoc.ModuleDocumenter
, sphinx.ext.autodoc.ModuleLevelDocumenter
Resolve the module and name of the object to document given by the arguments and the current module/class. Must return a pair of the module name and a chain of attributes; for example, it would return ``('zipfile', ['ZipFile', 'open'])`` for the ``zipfile.ZipFile.open`` method.
Parameters | |
modname:str | Undocumented |
parents:Any | Undocumented |
path:str | Undocumented |
base:Any | Undocumented |
Returns | |
tuple[ | Undocumented |
sphinx.ext.autodoc.ModuleDocumenter
Sort the given member list.
Parameters | |
documenters:list[ | Undocumented |
order:str | Undocumented |
Returns | |
list[ | Undocumented |
sphinx.ext.autodoc.AttributeDocumenter
, sphinx.ext.autodoc.ClassDocumenter
, sphinx.ext.autodoc.DataDocumenter
Undocumented