-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Handling path identifiers #107
Comments
Thanks 🙂 So, I would be OK with the change if there wasn't an issue with it: doing this means we allow collecting and rendering docs for the same module multiple times (the different versions of it), and this is not compatible with how our object inventories work. Cross-references and inter-links are a pretty important feature of code documentation tools, and I don't want to allow changes that will generate issues in the future. Of course, if we can find a way to mitigate the issue, I'd be considering this feature with more interest 🙂 A few initial thoughts:
I'd like to see the layout of your built docs, to see where each inventory could be put.h, and if this proposal makes any sense. You see that that is quite challenging to get right, so unfortunately I believe you'll have to maintain your custom handler for a bit longer 😕 You mentioned keeping updated with the main branch: do I guess correctly that you're using a fork? Another solution would be to depend on the handler (no forks), subclassing it and overriding the |
Yeah, cross-references and inter-links are broken in our documentation when referencing another package, but since our packages are almost all independent we never really saw that issue. But I can see why it would be important to keep them working. In that sense I can't see any solution unfortunately. For the inventory I didn't exactly understand how it's used, since I couldn't find any references in the python handler. I suppose it's managed from mkdocstrings? In any case we could make it use different inventories based on the root path instead of passing the info (it's supposed that all the modules from a version share the same root path), but without a solution for the cross-references that would be useless. :sad Thanks for the suggestions, I think I'll go with the subclass solution, it sounds like the most efficient. I didn't think about it but it could be the best way to go given our situation. For now I think you can close this issue, unless you don't have a mind-blowing idea for the cross-references hahaha. |
Thanks for your feedback! I will close this then, while keeping in mind that some users have this need 🙂 |
Discussed in #105
Following mkdocstrings/griffe#158
Premises
Based on discussion on mkdocstrings/griffe#158 I ended up making my custom handler based on this repository.
The purpose is to allow handling of path identifiers like
::: photon/ph_diskconnection/1.6.0/ph_diskconnection.managers.usd.assemblymanager
The original issue is that our pipeline is dividing submodules per version, since we are using AcademySoftwareFoundation/rez that allows us to build different environments based on the project we're working on.
Obviously I can't use the identifier
::: photon.ph_diskconnection.1.6.0.ph_diskconnection.managers.usd.assemblymanager
Issue
Having our own handler implies that we need to keep it updated with the main branch from this repository and it is quite time consuming.
So I thought that adding the changes from our custom handler to this repo would make a nice additional feature that maybe other people could use.
Solution
The solution is simple, it is based on recognizing wether the given identifier is a path and splitting the package path from the actual identifier. Also, if the module identifier comes from a path, it is treated as an unknown module.
The test for this special case would be very generic, where we could just provide whatever path to a python module.
The text was updated successfully, but these errors were encountered: