-
Notifications
You must be signed in to change notification settings - Fork 1
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
Find parent doc string for relative crossrefs #6
Comments
I think that the mkdocstrings render method already handles the case where the target class does not directly define the method. What is not handled is when the target class overrides the method but does not provide a doc string. In that case, we would like to redirect to the closest ancestor that provides a doc-string. Probably mkdocstrings should do that, so it may not be worthwhile trying to fix that in this extension. |
I recently released a Griffe extension to inherit docstrings, as part of the Insiders program. |
The |
Correction: it's now free, and was released at the same time as mkdocstrings-python 1.8 🙂
I suppose so. It's not always easy to remember exactly what mkdocstrings-python and autorefs do, but I think they do this:
The last fix in mkdocstrings-python regarding this behavior is from august: https://mkdocstrings.github.io/griffe/changelog/#0351-2023-08-26, so I'm surprised it didn't work for you. But I might forget something. As I said, not easy to remember the exact flow 😄 |
Ah right. I didn't read that closely enough. So you need to install the https://mkdocstrings.github.io/griffe-inherited-docstrings/? Is there a reason that was not just bundled directly into griffe or mkdocstrings-python? |
Yep, you can read the relevant discussion here: mkdocstrings/griffe#96. In short: it would have been hacky in both mkdocstrings-python and Griffe. With current Griffe's architecture, inheriting docstrings is a permanent side-effect. Back and forth inheriting/un-inheriting docstring would not have been super elegant or efficient. So it was best implemented as an extension. |
mkdocstrings does not currently support references to members not explicitly defined in subclass, so
instead of just being able to write something like
[foo][.]
you might have to write[foo][(m).ParentClass.]
or worse.
It would be nice if we could automatically handle this redirection.
The text was updated successfully, but these errors were encountered: