python - how to generate function signature with sphinx? -
the package structure , files set this:
$ tree . . ├── doc │ ├── makefile │ ├── readme.md │ ├── _build │ ├── _static │ ├── conf.py │ ├── foo.rst │ ├── index.rst │ └── make.bat └── foo ├── __init__.py └── spam.py $ cat foo/__init__.py r''' foo module ============== .. autosummary:: :toctree: generated spam ''' $ cat foo/spam.py r''' spam module =============== ''' def prepare(a): '''prepare function. parameters ---------- : int ''' print(a) $ cat doc/index.rst welcome foo's documentation! ===================================== api reference ------------- .. toctree:: :maxdepth: 1 foo indices , tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` $ cat doc/foo.rst .. automodule:: foo after make html generate sphinx documentation, function prepare listed out there not signature of function documented:
$ cat generated/foo.spam.rst foo.spam ======== .. automodule:: foo.spam .. rubric:: functions .. autosummary:: prepare my question how generate then, how can automatically generate function signature in case?
.. automodule:: foo.spam i think problem (if haven't solved yet)
wouldn't correct way
.. automodule:: spam
Comments
Post a Comment