diff options
author | Georg Brandl <georg@python.org> | 2011-01-03 21:48:37 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-01-03 21:48:37 +0100 |
commit | 92cb77a1315065dc206c880c65c83b87c8576070 (patch) | |
tree | 81deceeb7f6a147a8e59c1df2bc0db69d69da82c /sphinx/ext/autodoc.py | |
parent | 7401622583248fe26bfcf8da283f068126aea7f4 (diff) | |
download | sphinx-git-92cb77a1315065dc206c880c65c83b87c8576070.tar.gz |
#176: Provide ``private-members`` option for autodoc directives.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r-- | sphinx/ext/autodoc.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 3b378001f..64b3d2d49 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -518,8 +518,9 @@ class Documenter(object): Members are skipped if - - they are private (except if given explicitly) - - they are undocumented (except if undoc-members is given) + - they are private (except if given explicitly or the private-members + option is set) + - they are undocumented (except if the undoc-members option is set) The user can override the skipping decision by connecting to the ``autodoc-skip-member`` event. @@ -541,7 +542,7 @@ class Documenter(object): if want_all and membername.startswith('_'): # ignore members whose name starts with _ by default - skip = True + skip = not self.options.private_members elif (namespace, membername) in attr_docs: # keep documented attributes skip = False @@ -713,6 +714,7 @@ class ModuleDocumenter(Documenter): 'show-inheritance': bool_option, 'synopsis': identity, 'platform': identity, 'deprecated': bool_option, 'member-order': identity, 'exclude-members': members_set_option, + 'private-members': bool_option, } @classmethod @@ -866,7 +868,7 @@ class ClassDocumenter(ModuleLevelDocumenter): 'members': members_option, 'undoc-members': bool_option, 'noindex': bool_option, 'inherited-members': bool_option, 'show-inheritance': bool_option, 'member-order': identity, - 'exclude-members': members_set_option, + 'exclude-members': members_set_option, 'private-members': bool_option, } @classmethod @@ -1134,7 +1136,7 @@ class AutoDirective(Directive): # flags that can be given in autodoc_default_flags _default_flags = set(['members', 'undoc-members', 'inherited-members', - 'show-inheritance']) + 'show-inheritance', 'private-members']) # standard docutils directive settings has_content = True |