On Wed, 2022-03-02 at 08:21 +0000, c.bu...@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].

Hope this helps,
Stephen

[1] 
https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html#cmdoption-sphinx-apidoc-P
[2] 
https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-option-automodule-private-members
[3] https://stackoverflow.com/a/44638788/613428

> 
> Maybe I am totaly wrong and sphinx.ext.autodoc is not responsible for
> that?
> 
> [1] -- <https://codeberg.org/buhtz/sphinx_versuch>
> [2] -- <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/be40e1500c0b5c1fadf096268b36eaa5db63fe03.camel%40that.guru.

Reply via email to