diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-11-16 18:15:53 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-11-16 18:19:33 +0900 |
commit | 491b19d6bb93a6b7aaa1cc7b4004c7f5f52369bb (patch) | |
tree | ade9ad07b6ce965eb1c64dbe36f0ef1edc4a6120 /sphinx/ext/autosummary/generate.py | |
parent | 66c3dd3adb909fd028a190ab9888e6d09b5ce7c7 (diff) | |
download | sphinx-git-491b19d6bb93a6b7aaa1cc7b4004c7f5f52369bb.tar.gz |
autosummary: Allows to document a member forcedly if skip-member handler returns False
Diffstat (limited to 'sphinx/ext/autosummary/generate.py')
-rw-r--r-- | sphinx/ext/autosummary/generate.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py index 177d25e9d..e1dd1be51 100644 --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -151,6 +151,7 @@ def generate_autosummary_content(name: str, obj: Any, parent: Any, def get_members(obj: Any, types: Set[str], include_public: List[str] = [], imported: bool = True) -> Tuple[List[str], List[str]]: items = [] # type: List[str] + public = [] # type: List[str] for name in dir(obj): try: value = safe_getattr(obj, name) @@ -160,10 +161,18 @@ def generate_autosummary_content(name: str, obj: Any, parent: Any, if documenter.objtype in types: # skip imported members if expected if imported or getattr(value, '__module__', None) == obj.__name__: - if not skip_member(value, name, documenter.objtype): + skipped = skip_member(value, name, documenter.objtype) + if skipped is True: + pass + elif skipped is False: + # show the member forcedly items.append(name) - public = [x for x in items - if x in include_public or not x.startswith('_')] + public.append(name) + else: + items.append(name) + if name in include_public or not name.startswith('_'): + # considers member as public + public.append(name) return public, items ns = {} # type: Dict[str, Any] |