3

How do I make a Sphinx doc with one .py file that has only functions?

I have a .py file with multiple functions that have docstrings in them already but don't want to make a :function:: console.someFunction for all the functions. Is there a smarter or better way to iterate through all the functions?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
user805981
  • 9,979
  • 8
  • 44
  • 64

1 Answers1

4

Yes, it is possible, what you need is autodoc. Don't forget to add sphinx.ext.autodoc to conf.py.

Set up your sphinx docs as usual and in your .rst file have something along the lines of:

.. automodule:: myfile
   :members:
sashkello
  • 17,306
  • 24
  • 81
  • 109