Documenting module/class/function bodies in python sphinx docs
-
11-09-2019 - |
Question
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:
Solution
If this still matters: The viewcode extension can do this, but needs the development version (1.0) of Sphinx
OTHER TIPS
I don't believe so. Autodoc is only for pulling the documentation out of the source code.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow