I have multiple methods but most of them have 2 parameters in common i.e. params with same name in different methods. I want to reference that parameter in other param docstring through substitutions in global.rst, I wasn't able to find a way to link to the parameter of that specific method, instead I was forced to specify exact method and param name.
Here's the substitution in global.rst
.. |foo| replace:: Replace with :paramref:`foo`.
And heres a example class with methods with same params:
class FooFather():
def foo1(foo, bar):
"""
foo (:obj:`Any`): this is foo
bar (:obj:`Any`): |foo|
"""
def foo2(foo, bar):
"""
foo (:obj:`Any`): this is foo
bar (:obj:`Any`): |foo|
"""
Now I can't link to the foo of that specific method from bar, I have to explicitly specify the method of the parameter to link to, like so:
.. |foo| replace:: Replace with :paramref:`FooFather.foo1.foo`.
I want that foo2's documentation links to foo2's foo param and similar. Is there any way around this?