我正在尝试使用pdoc生成文档,其中的文档字符串如下所示:
"""
I am a description of what a method does
:param param1: an integer
:param param2: a str
"""我发现了这个问题:How to preserve line breaks when generating python docs using sphinx,但是在每一行加上前缀|的建议对我不起作用(它就是这样出现的)
| :param param1: an integer | :param param2: a str除了在每行末尾使用\n之外,还有什么想法吗?
发布于 2016-08-31 21:10:39
所以,我也遇到了同样的问题。我就想明白了。Pdoc uses markdown。您希望在mark down中使用软中断来告诉它在保持内容分组的同时创建一个新行。软中断是通过在要以新行结束的行尾放置两个尾随空格来实现的。
你可以看看这篇教程,看看我的意思。http://www.markdowntutorial.com/lesson/7/
此外,请注意您使用的是哪种编辑器。它可能正在删除尾随空格!Trailing spaces removed on Python heredoc lines in PyCharm
"""
I am a description of what a method does
:param param1: an integer <-- line ends right here with two spaces
:param param2: a str
"""https://stackoverflow.com/questions/32704176
复制相似问题