【发布时间】:2020-06-24 13:04:29
【问题描述】:
我正在学习如何使用 Sphinx 为我的代码创建文档。在我看到一些这样的例子之后:
def complex(real=0.0, imag=0.0):
"""Form a complex number.
Keyword arguments:
real -- the real part (default 0.0)
imag -- the imaginary part (default 0.0)
"""
if imag == 0.0 and real == 0.0: return complex_zero
...
cmets 使用什么语言让 Sphinx 理解并捕捉它们? 如果没有这种语法和逻辑,Sphinx 在我的代码中看不到 cmets,当我生成 HTML 时,模块是空的。
这里是一个例子:
【问题讨论】:
标签: python-sphinx docstring sphinx-napoleon