I want, within an explanatory documentation, a reference to the documentation of a Python class and, a little later, to its constructor. So imagine there is a file
# MyLib/MyClass.py
class MyClass:
"""Class Introduction"""
def __init__(paramX):
""":param paramX: Xes out things"""
and my rst file
#MyLib/docs/source/MyDoc.rst
Some text where :ref:`here` is my reference to "Class Introduction"
and :ref:`there` follows my reference to the __init__ method documentation
How can I get the reference working: How and where within the Sphinx files do I need to include the Python file and how do I define (in the Python file) and resolve (in the rst file) the references? The expected output would be something like this:
Some text where <link to documentation of class _MyClass_>...
and
'class MyClass
def __init__(paramX):
paramX: Xes out things'
where as described the brackets <..> include a link to the documentation and the documentation itself appears after the 'and', referenced in the rst file by :ref:`here`
and :ref:`there`
, respectively.