I am documenting a class with Sphinx and simple want to skip one of the classes members:
class StatusUpdateAdapter(logging.LoggerAdapter): """ """ def __init__(self, status_update_func, logger, extra={}): """ """ pass def log(self, *args, **kwargs): pass
How can I cause sphinx NOT to document the log member? I would like to do this in the StatusUpdateAdapter or log docstring's if possible.
autodoc provides several directives that are versions of the usual py:module , py:class and so forth. On parsing time, they import the corresponding module and extract the docstring of the given objects, inserting them into the page source under a suitable py:module , py:class etc. directive.
toctree is a Sphinx-defined directive in which you explicitly list documents whose TOCs will be listed out.
sphinx-apidoc is a tool for automatic generation of Sphinx sources that, using the autodoc extension, document a whole package in the style of other automatic API documentation tools. MODULE_PATH is the path to a Python package to document, and OUTPUT_PATH is the directory where the generated sources are placed.
You can now (as of version 0.6) use :exclude-members:
to exclude specific members from the documentation:
The directives supporting member documentation also have a exclude-members option that can be used to exclude single member names from documentation, if all members are to be documented.
New in version 0.6.
Source: http://www.sphinx-doc.org/en/stable/ext/autodoc.html
In your specific case, you would add :exclude-members: log
into your .rst
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With