-
-
Notifications
You must be signed in to change notification settings - Fork 200
Submodule functions in __all__ get correctly hoisted to top-level docs, but not submodule variables #774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This needs a reproducer.
Agreed, that's a bug in the template. Contributions welcome! |
Attached. 2025-02-10 - pdoc variable.zip Results look like: ![]()
I'm not sure. When I change the command in the reproducer to:
And then directly under line 46 of module.html.jinja2 where it says
Then it outputs:
So the bug is possibly that it is passing a submodule in the first place when there should be none? Alternatively, you only print "public" submodules:
So perhaps I don't have the broader understanding of pdoc to know which you intend. |
yeah, it shouldn't be passed in the first place, it should be filtered out here: Lines 50 to 55 in 4991583
Maybe some bug in the |
Problem Description
I have a package with lots of modules within. In the package
__init__.py
, I define__all__
with all of the functions I want to expose to the user. This works great, and pdoc puts all the functions in a single list under "API Documentation". Exactly what I want.The problem is that I also include a single
settings
dictionary variable imported from a submodule, alongside all the functions imported from submodules. I include that in__all__
, but for some reason pdoc then creates a separate "Submodules" section of the documentation that lists "settings" underneath, that links to a separate page, that documents the variable.I absolutely want to include the variable documentation -- I just want it to be listed next to the functions in the order it is specified in
__all__
. I don't see any reason for forcing variables that aren't functions into submodule listings, so this seems to be a bug?Expected behavior: non-function variables in
__all__
get included alongside function variablesActual behavior: non-function variables in
__all__
are still being documented as belonging to submodulesSystem Information
pdoc: 15.0.1
Python: 3.12.8
Platform: macOS-15.2-arm64-arm-64bit
The text was updated successfully, but these errors were encountered: