I am writing a py project and use sphinx for the documentation. This is working fine so far.
I know it is possible to include code with something like this:
class Foo():
"""Documatation for Foo
.. code-block:: python
# Use Foo
f = Foo()
"""
...
I have some larger code sections, which should be included in the documentation. In the upper example, I have the trouble, when e.g. the name of Foo() is changing, I have to change it twice.
Is there a way include something like this in the code?
""" ..docu-code-from-hear """
a = 1
b = 2
c = a+b
""" ..docu-code-to-hear """