-
Notifications
You must be signed in to change notification settings - Fork 8
Description
What's needed?
In mkdocstrings-python 1.19, finally we can write relative and scoped references in docs, avoiding the huge strings to do cross references:
class VeryLongClassName:
some_prop: int
"""Some doc.
This does whatever with [some_meth()][frequenz.some.package.very.nested.and.with.VeryLongClassName.some_meth].
"""
def some_meth(): ...Now can be something like:
[`some_meth()`][some_meth]
Proposed solution
Depend on 1.19 and enable the new options in the templates and this project:
plugins:
- mkdocstrings:
handlers:
python:
options:
relative_crossrefs: true
scoped_crossrefs: trueUse cases
No response
Alternatives and workarounds
No response
Additional context
Limitations of scoped cross-refs:
Cross-referencing an imported object will directly link to this object if the objects inventory of the project it comes from was loaded. You won't be able to cross-reference it within your own documentation with scoped references, if you happen to be rendering this external object too. In that case, you can use an absolute reference or a relative one instead.
Another limitation is that you won't be able to reference an external package if its name can be resolved in the current object's scope.