0

I have a Python package which is spread over multiple files:

package/__init__.py
package/thing_a.py
package/thing_b.py
package/thing_c.py
package/submodule/__init__.py
package/submodule/...

The thing_XXXs break apart chunks of internal code into something that is easier for me to manage. The __init__.py files exports the public APIs that I want at the top-level and within each submodule:

from .thing_a import the_greatest_thing
from .thing_b import even_greater_thing
from .thing_c import i_am_the_best

What I would like is for the documentation to display the docs for the_greatest_thing, even_greater_thing and i_am_the_best and provide a link to look at what's in submodule. What I get is a landing page which shows thing_a, thing_b, thing_c and submodule as submodules which I need to click on to get documentation. All the thing_XXXs are private and I use __init__.py to decide what gets exported - this is true also for the contents of the submodule. I would be happy to prefix them with underscores (which does prevent them showing up in the documentation) but I still can't seem to figure out how to bring all the documentation I want together.

Can this be done with pdoc? Or am I trying to do something wild and silly?

1 Answers1

0

You should be able to explicitly include the in the documentation of __init__.py by listing them in __all__: https://pdoc.dev/docs/pdoc.html#control-what-is-documented

Maximilian Hils
  • 6,309
  • 3
  • 27
  • 46