oar*_*ish 6 python-3.x python-sphinx
我一直有这个问题,我想写一个这样的文档字符串:
def foo(arg):
'''Add ``arg`` to the list of :class:`foo.bar.baz.Argument`s.'''
pass
Run Code Online (Sandbox Code Playgroud)
但是,这不起作用,Sphinx 会警告说
py:class reference target not found: foo.bar.baz.Argument`s
Run Code Online (Sandbox Code Playgroud)
所以它将s结束反引号之后的作为类名的一部分。这不会发生在像点这样的标点符号上.。除了在类名和 Plural-s 之间添加一个空格(看起来很疯狂)之外,还有什么可以做的吗?
您应该能够使用反斜杠转义的 whitespace。
def foo(arg):
'''Add ``arg`` to the list of :class:`foo.bar.baz.Argument`\ s.'''
pass
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
278 次 |
| 最近记录: |