Generate documentation for private functions using pydoc

24 views Asked by At

I'm using pdoc to generate html documentation based on python files. Unfortunately private methods like _example_method aren't included in documentation. I've tried to use --all-modules in pdoc command or set env variable export PODOC_ALL_SUBMODULES=true. No one of this solutions didn't work so I'm wondering is there any other option to get result I want to.

1

There are 1 answers

0
Maximilian Hils On

pdoc does not provide a builtin switch to document all private methods, because private methods should not be part of your public API and thus should not appear in documentation. If you think that's wrong, you can override pdoc's behavior with a custom module template.

https://pdoc.dev/docs/pdoc.html#control-what-is-documented is the canonical document detailing how to control visibility.