I'm using Sphinx to document parts of my Python code.
I would like to include only a variable from my class in my documentation.
For example, I tried this but without success :
.. literalinclude:: MyClass.py
:pyobject: MyClass.aVariable
:language: python
I see only one solution but if my code change in the next release the line numbers of the variable could change :
.. literalinclude:: MyClass.py
:language: python
:lines: 2-3
Is there another solution to filter only this variable ?