Ada*_*ris 17 python documentation-generation python-sphinx api-doc
我正在尝试清理我的python代码文档,并决定使用sphinx-doc,因为它看起来不错.我喜欢如何使用以下标签引用其他类和方法:
:class:`mymodule.MyClass` About my class.
:meth:`mymodule.MyClass.myfunction` And my cool function
Run Code Online (Sandbox Code Playgroud)
我试图弄清楚如何在函数中记录参数名称,所以如果我有一个像这样的函数:
def do_this(parameter1, parameter2):
"""
I can describe do_this.
:something?:`parameter1` And then describe the parameter.
"""
Run Code Online (Sandbox Code Playgroud)
这是最好的做法是什么?
更新:
正确的语法是:
def do_this(parameter1, parameter2):
"""
I can describe do_this.
:something parameter1: And then describe the variable
"""
Run Code Online (Sandbox Code Playgroud)
Cri*_*ole 11
通常,"函数变量"称为参数;).
它在此处记录:http://sphinx.pocoo.org/domains.html#signatures
答案是 :param ________
编辑免责声明:我从未使用或听说过狮身人面像......这篇文章主要是"搜索什么词".希望它有所帮助.
| 归档时间: |
|
| 查看次数: |
15519 次 |
| 最近记录: |