diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-07-01 00:29:51 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-07-01 00:29:51 +0900 |
commit | 75477633b69b11858ae27c27f3af6e3ff2db928f (patch) | |
tree | a1d5b1bd3ffdc01fabd3ae594b1066ff25505eaf /sphinx/application.py | |
parent | 852c061cc64e2876ec206e5a7a116a40caf3fac6 (diff) | |
parent | 95723aa6f648597682ff4107250fb042ddb40f50 (diff) | |
download | sphinx-git-75477633b69b11858ae27c27f3af6e3ff2db928f.tar.gz |
Merge branch '2.0'
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index 577ec9ac8..68b221af8 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -990,8 +990,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` @@ -1003,11 +1003,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 |