-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Submodule exclusion - differences between approaches #341
Comments
I'm not sure if I understand what you are saying. Listing a module in So again, not sure if I get you correctly. But would it help if instead of
we would say
? |
Thanks for the speedy response. I'll lay out a concrete example to showcase the differences I tried conveying above. I'll use tlgs/the-code-book which is a rather simple package/module that I'm using to try out .
├── codebook
│ ├── __init__.py
│ ├── substitution.py
│ ├── transposition.py
│ └── utils.py
├── pyproject.toml
├── README.md
├── setup.cfg
└── UNLICENSE I'll exemplify both scenarios below; hopefully they illustrate what I meant above. Scenario 1
__all__ = ["substitution", "transposition"]
Scenario 2Empty
|
Ah, right - thanks for clarifying! This is indeed a bit of a tricky edge case we have here.
I'll have to think about what works best - comments are welcome! The benefit of 1) would be that it is consistent with the rest of pdoc and also simplifies the template logic quite a bit. I'm not sure how useful it is to have submodules listed as page contents after all. The benefit of 2) would be the empty page in your second example would actually have useful content. Then again, this very quickly gets messy and unwieldy for slightly larger packages. Having an empty page could actually encourage folks to write useful docs that fill the empty space. 🙊 I'm not a big fan of 3) - it feels like we just have unnecessary complexity here. |
Happy to see this is actually helpful and could improve pdoc's experience! I believe 1) describes the behavior I was expecting. I agree, documenting a package's |
I've pushed experimental changes for approach 1) to main, see CHANGELOG.md. 😃 |
This is now fixed in pdoc 10, thanks again! 🍰 |
Problem Description
Despite what the documentation suggests, when it comes to submodule exclusion specifying
__all__
does not have the same effect as passing negative regular expression !patterns as part of the module specification.Specifically, specifing submodules in
__all__
will render the modules' docstrings, as well as generate theAPI Documentation
section; the same is not true when using the alternative approach.I uderstand the difference in approaches, just thought it would be worth pointing out so as to make the documentation clearer.
Related: Perhaps allow for documentation specific issues? They don't really fit in with the bugs/enhancement options currently in place.
Steps to reproduce the behavior:
pdoc foo
;__all__ = ["bar"]
infoo/__init__.py
pdoc foo !foo.baz
; no specified__all__
infoo/__init__.py
System Information
The text was updated successfully, but these errors were encountered: