views:

145

answers:

2

Is there a way with Sphinx documentation to output a function or class body (the code itself) with the autodoc feature? I'm using autodoc to much success. In addition to the docstrings getting pulled in to the documentation I want like a link to click for each function where it will show you the source... is that possible?

This is about what most of my documentation looks like now:

   .. module:`foo.mymodule`

    Title
    ===================


    .. automodule:: foo.mymodule

    .. autoclass:: MyModulesClass
        :members:
        :undoc-members:
+1  A: 

I don't believe so. Autodoc is only for pulling the documentation out of the source code.

Patrick Altman
+1  A: 

If this still matters: The viewcode extension can do this, but needs the development version (1.0) of Sphinx

Florian Diesch
Sweet thanks for the tip
perrierism