【发布时间】:2021-04-23 07:27:10
【问题描述】:
我的 python 项目中有以下 docString:
def challenge():
"""Route for POST a challenge.
For call this route, we need to pass a serialNumber on body form.
If this serialNumber is in the database and corresponds to a tablet we call methods for create challenge
:returns: An HTTP response with a challenge
EXAMPLE::
REQUEST
curl --location --request POST 'xxxx:xxxx/challenge'
--form 'serialNumber="xxxxx"'
RESPONSE
{
"challenge": "xxxx"
}
"""
当我运行 make html 时,sphinx 给我以下错误:
docstring of src.modules.challenge.router.challenge:15: WARNING: Definition list ends without a blank line; unexpected unindent.
格式根本不是我想要的文档。我希望我的 API 的每条路由都以文本块或代码块的形式插入请求/响应示例。
【问题讨论】:
标签: python python-sphinx docstring