-
Describe the bug I've written a custom handler to auto-generate documentation for internal models within my app, I'm using this handler, in addition to the python legacy one to create API docs. The index pages are generated with If I use cross-reference links within the actual markdown section of the documentation, the links to Python models work fine. But my custom ones don't. I'm getting errors like:
I added some debug output in both my collector and renderer, and I am fairly sure both do what they are supposed to do. Is there a good way to debug this? I have no idea where to start. It's also very possible that I'm using this wrong, and my custom handler is to blame. I'd still need a few pointers on where to begin looking, though. Here is an example:
Is there something obvious wrong with what I'm doing? To Reproduce I don't expect anyone to actually install my project to figure this out, but in case you want to because you think it's a genuine bug, there are install instructions on the readme: https://github.com/DHARPA-Project/kiara After it's in a virtual env, a simple: Expected behavior I'd like to see links to the item description when using an identifier for my custom handler Information (please complete the following information):
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Nice work! I think your collector and renderer just lack one or two things. First, the permalink of your Second, and it's a bit hard to understand because lots of things happen in the code between mkdocstrings itself, autorefs, and the handlers: when autorefs cannot resolve a reference immediately, it falls back to asking every handler if it knows the reference, and if yes, what are its possible identifiers/anchors (in Python an object can have multiple identifiers, depending where it is defined and where it is imported and made public). It then iterates on these identifiers to see if it has knows a URL for it. That's what I don't see in your renderer: the I hope this helps, let me know if something is unclear 🙂 |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for your help, I'll try that out tomorrow! I wasn't aware of the |
Beta Was this translation helpful? Give feedback.
-
Got it working, all it needed was me having to define a proper id for the anchor in my items list, and use that as result of the Thanks again for your help, much appreciated! |
Beta Was this translation helpful? Give feedback.
Nice work! I think your collector and renderer just lack one or two things.
First, the permalink of your
hash
objects is#valuehash
. This is a good indication that autorefs, the plugin responsible for resolving cross-references, won't be able to find it using the full pathkiara_info.modules.value.hash
.Second, and it's a bit hard to understand because lots of things happen in the code between mkdocstrings itself, autorefs, and the handlers: when autorefs cannot resolve a reference immediately, it falls back to asking every handler if it knows the reference, and if yes, what are its possible identifiers/anchors (in Python an object can have multiple identifiers, depending where it is defi…