【发布时间】:2018-08-13 00:50:40
【问题描述】:
我想知道在使用 Sphinx 生成自动文档时如何换行。我没有使用默认的 Sphinx 文档字符串格式 reStructuredText,但我使用的是 Numpydoc 格式。我尝试使用 '\n' 但它会换行,我只需要一个新行。这是一个 Python 模块的示例...
""" This is the first sentences
| this is the second sentence at line 2 ... note that vertical bar
| this is the second sentence at line 3 ... note that vertical bar
......
def function1 (input):
""" this function docstring starts here
| this is not sentence number 2 at the vertical bar is not working
| this is not sentence number 3 at the vertical bar is not working
| this is not sentence number 4 at the vertical bar is not working
"""
【问题讨论】:
-
line blocks 会做你想做的事吗?
-
谢谢,竖线适用于模块文档字符串,但不适用于函数文档字符串。我不知道为什么。我知道基于vertical bar is part of the restructured Text的线块。
-
请在您的问题中提供示例。
标签: python python-sphinx docstring numpydoc