I'd like to reference a previously-documented function parameter elsewhere in a Python docstring. Consider the following (admittedly completely artificial) example:
def foo(bar):
"""Perform foo action
:param bar: The bar parameter
"""
def nested():
"""Some nested function that depends on enclosing scope's bar parameter.
I'd like to reference function foo's bar parameter here
with a link, is that possible?"""
return bar * bar
# ...
return nested()
Is there a simple way to embed a parameter reference using Sphinx markup, or will this happen automagically?
(I'm a complete Sphinx newbie. I've been scanning the Sphinx docs and haven't found an answer to this question, or an example demonstrating proper markup.)