Generate from source -------------------- Write the docstrings respecting a certain `format `_. Documenting from source is straightforward (if the code is packaged) .. code-block:: rst .. automodule:: mypackage.mymodule :members: To show a specific ``pyobject`` in the documentation which is defined in a file (using the relative path): .. code-block:: rst .. literalinclude:: relative/path/from/current/mypackage/mymodule.py :pyobject: myfunc :emphasize-lines: 3,4 :linenos: :caption: my caption :name: the name To get an autolabel from ``literalinclude`` both the caption and name must be set and the caption will be used as default text link.