【发布时间】:2018-11-01 17:03:38
【问题描述】:
我正在使用工具pydoc 自动生成文档。给定函数:
def sum(a, b):
"""Returns the sum of a and b."""
return a + b
我很好奇是否有一种结构化的方式来使用 Markdown 来突出对函数参数标签的引用?例如:
"""Returns the sum of 'a' and 'b'."""
"""Returns the sum of `a` and `b."""
"""Returns the sum of *a* and *b*."""
"""Returns the sum of **a** and **b**."""
类似于Referencing parameters in a Python docstring 这个问题,它是关于使用 Sphinx 而不是 pydoc。
另外请注意,我对引用函数参数的标签(而不是类型)感到好奇。
【问题讨论】:
-
@LavanyaPant,谢谢。您链接的问题讨论了如何注释参数的类型,我对此并不感兴趣。我对引用参数标签的标准方法更加好奇。