Open pawamoy opened 1 year ago
Not sure what you mean exactly , but I got cross-reference working in my docstring using the TOC entry. This part of the doc got me on the track : https://mkdocstrings.github.io/python/
Then I managed to reference a method of separate class in docstring using
[Link Label][my_package.module.function]
Hope i'm not totally off subject and that can help
Thanks for helping!
Here's what I meant. In your docstrings, you can write sections to document available classes, functions or methods:
class Flags:
...
class A:
"""Class A.
Methods
-------
method_a(value)
Method a.
method_b(flag=Flags.NONE, store=False)
Method b.
"""
def method_a(self, value: str):
"""Method a."""
def method_b(self, flag: int, store: bool):
"""Method b."""
The goal here is to re-parse these signatures (method_a(value)
and method_b(flag=Flags.NONE, store=False)
), which are just text in the docstring, as Griffe expressions, which will allow the renderer to automatically add cross-references to the parameters (value
maybe, flag
and store
for sure) or values (flags.None
).
Support automatic cross-references for documented functions/methods and classes signatures through the corresponding docstring sections.
Boost priority