mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add support for :meta public:
A common use case for this is a class like `namedtuple`, which has a public `_replace` method that is so-named in order not to conflict with arbitrary user-provided attributes. Rejected spellings include: * `:meta not-private:` * `:meta private: False`
This commit is contained in:
@@ -154,6 +154,21 @@ inserting them into the page source under a suitable :rst:dir:`py:module`,
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
* autodoc considers a member public if its docstring contains
|
||||
``:meta public:`` in its :ref:`info-field-lists`, even if it starts with
|
||||
an underscore.
|
||||
For example:
|
||||
|
||||
.. code-block:: rst
|
||||
|
||||
def _my_function(my_arg, my_other_arg):
|
||||
"""blah blah blah
|
||||
|
||||
:meta public:
|
||||
"""
|
||||
|
||||
.. versionadded:: 3.1
|
||||
|
||||
* Python "special" members (that is, those named like ``__special__``) will
|
||||
be included if the ``special-members`` flag option is given::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user