RNA*_*RNA 6 python documentation python-sphinx
包结构和文件设置如下:
$ 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'''
The Foo module
==============
.. autosummary::
:toctree: generated
spam
'''
$ cat foo/spam.py
r'''
The Spam Module
===============
'''
def prepare(a):
'''Prepare function.
Parameters
----------
a : int
'''
print(a)
$ cat doc/index.rst
Welcome to foo's documentation!
=====================================
API Reference
-------------
.. toctree::
:maxdepth: 1
foo
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
$ cat doc/foo.rst
.. automodule:: foo
Run Code Online (Sandbox Code Playgroud)
在make html
生成sphinx文档之后,prepare
列出了函数,但没有记录此函数的签名:
$ cat generated/foo.spam.rst
foo.spam
========
.. automodule:: foo.spam
.. rubric:: Functions
.. autosummary::
prepare
Run Code Online (Sandbox Code Playgroud)
我的问题是如何生成然后,在这种情况下如何自动生成函数签名?
.. automodule:: foo.spam
Run Code Online (Sandbox Code Playgroud)
我认为这是你的问题(如果你还没有解决)
正确的方法不是吗
.. automodule:: spam
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
406 次 |
最近记录: |