doc: Update document for autodoc :members: option

This commit is contained in:
Takeshi KOMIYA 2021-03-06 18:57:18 +09:00
parent 647510e184
commit f37e679fd1

View File

@ -89,33 +89,43 @@ inserting them into the page source under a suitable :rst:dir:`py:module`,
Boil the noodle *time* minutes. Boil the noodle *time* minutes.
**Options and advanced usage** .. rubric:: Options
* If you want to automatically document members, there's a ``members`` .. rst:directive:option:: members
option:: :type: no value or comma separated list
If set, autodoc will generate document for the members of the target
module, class or exception.
For example::
.. automodule:: noodle .. automodule:: noodle
:members: :members:
will document all module members (recursively), and :: will document all module members (recursively), and ::
.. autoclass:: Noodle .. autoclass:: Noodle
:members: :members:
will document all non-private member functions and properties (that is, will document all class member methods and properties.
those whose name doesn't start with ``_``).
For modules, ``__all__`` will be respected when looking for members unless By default, autodoc will not generate document for the members that are
you give the ``ignore-module-all`` flag option. Without private, not having docstrings, inherited from super class, or special
``ignore-module-all``, the order of the members will also be the order in members.
``__all__``.
You can also give an explicit list of members; only these will then be For modules, ``__all__`` will be respected when looking for members unless
documented:: you give the ``ignore-module-all`` flag option. Without
``ignore-module-all``, the order of the members will also be the order in
``__all__``.
You can also give an explicit list of members; only these will then be
documented::
.. autoclass:: Noodle .. autoclass:: Noodle
:members: eat, slurp :members: eat, slurp
**Options and advanced usage**
* If you want to make the ``members`` option (or other options described * If you want to make the ``members`` option (or other options described
below) the default, see :confval:`autodoc_default_options`. below) the default, see :confval:`autodoc_default_options`.