autodoc: Ignores py-files with beginning underline in filename
17 views
Skip to first unread message
c.b...@posteo.jp
unread,
Mar 2, 2022, 3:21:50 AM3/2/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sphinx...@googlegroups.com
I am quite new to sphinx I try to figuring out autodocumenting my
Python code with it. I have setup a test-project [1] to play around
with some settings.
It seams like that autodoc ignores py-files that start with an
underline; e.g. "_mypackage.py". I looked into the docu [2] but
couldn't find a setting to explain/modify that behavior.
Maybe I am totaly wrong and sphinx.ext.autodoc is not responsible for
that?
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sphinx...@googlegroups.com
On Wed, 2022-03-02 at 08:21 +0000, c.b...@posteo.jp wrote:
> I am quite new to sphinx I try to figuring out autodocumenting my
> Python code with it. I have setup a test-project [1] to play around
> with some settings.
>
> It seams like that autodoc ignores py-files that start with an
> underline; e.g. "_mypackage.py". I looked into the docu [2] but
> couldn't find a setting to explain/modify that behavior.
By default, private members are not documented.
If you're generating this documentation using 'sphinx-apidoc', you want to pass
the '--private ' / '-P' option [1]
If you are manually writing pages that use 'sphinx.ext.autodoc' directives,
then you can enable documentation of private members by add the 'private-
members' option [1] to each directive or by adding ':meta public:' to the
doctext of private classes, functions and variables that you wish to document.
You can also configure this behavior globally using the
'autodoc_default_options' flag [2].