docs: enable private docstring submembers sphinx (#28589)

This commit is contained in:
Erick Friis 2024-12-06 13:36:34 -08:00 committed by GitHub
parent 791d7e965e
commit 1cedf401a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,6 +87,14 @@ class Beta(BaseAdmonition):
def setup(app):
app.add_directive("example_links", ExampleLinksDirective)
app.add_directive("beta", Beta)
app.connect('autodoc-skip-member', skip_private_members)
def skip_private_members(app, what, name, obj, skip, options):
if skip:
return True
if hasattr(obj, '__doc__') and obj.__doc__ and ':private:' in obj.__doc__:
return True
return None
# -- Project information -----------------------------------------------------