mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #6536 from tk0miya/6475_overridable_add_autodocumenter
Close #6475: Add override argument to app.add_autodocumenter()
This commit is contained in:
commit
a2c052475f
1
CHANGES
1
CHANGES
@ -31,6 +31,7 @@ Features added
|
||||
:confval:`html_extra_path` directories are inside output directory
|
||||
* #6514: html: Add a label to search input for accessability purposes
|
||||
* #5602: apidoc: Add ``--templatedir`` option
|
||||
* #6475: Add ``override`` argument to ``app.add_autodocumenter()``
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
|
@ -1054,8 +1054,8 @@ class Sphinx:
|
||||
else:
|
||||
lexer_classes[alias] = lexer
|
||||
|
||||
def add_autodocumenter(self, cls):
|
||||
# type: (Any) -> None
|
||||
def add_autodocumenter(self, cls, override=False):
|
||||
# type: (Any, bool) -> None
|
||||
"""Register a new documenter class for the autodoc extension.
|
||||
|
||||
Add *cls* as a new documenter class for the :mod:`sphinx.ext.autodoc`
|
||||
@ -1067,11 +1067,13 @@ class Sphinx:
|
||||
.. todo:: Add real docs for Documenter and subclassing
|
||||
|
||||
.. versionadded:: 0.6
|
||||
.. versionchanged:: 2.2
|
||||
Add *override* keyword.
|
||||
"""
|
||||
logger.debug('[app] adding autodocumenter: %r', cls)
|
||||
from sphinx.ext.autodoc.directive import AutodocDirective
|
||||
self.registry.add_documenter(cls.objtype, cls)
|
||||
self.add_directive('auto' + cls.objtype, AutodocDirective)
|
||||
self.add_directive('auto' + cls.objtype, AutodocDirective, override=override)
|
||||
|
||||
def add_autodoc_attrgetter(self, typ, getter):
|
||||
# type: (Type, Callable[[Any, str, Any], Any]) -> None
|
||||
|
Loading…
Reference in New Issue
Block a user