在Pythons Epyd中记录段落之间的标记

2024-05-23 17:43:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在为python中的方法编写文档,这些方法应该可以供最终用户阅读。我使用Epydoc字段标记来记录基于给定要求的参数,并尝试将参数描述放在方法描述和使用方法示例之间:

"""
A description of what this utility does.


@param utilityArguments: Description of arguments
@type utilityArguments: String


A list of examples:

example1

example2

example3

"""

不幸的是,我没有成功地找到从类型标记中排除示例的方法,它们被添加到类型标记中,而不是被分开。我尽量不把参数移到参数的末尾,因为我们觉得这样看起来更整洁;有没有办法终止文档的标记并从中排除任何后面的文本?你知道吗


Tags: of方法文档标记示例类型参数记录
1条回答
网友
1楼 · 发布于 2024-05-23 17:43:06

抱歉,作为坏消息的传递者,Epydoc documentation特别禁止这种行为:

Fields must be placed at the end of the docstring, after the description of the object. Fields may be included in any order.

由于字段都是@param@return标记,这意味着字段后面的所有内容都将被视为该字段的一部分(除非它是另一个字段)。你知道吗

相关问题 更多 >