如何将intersphinx链接放入标准库文档中的任意方法?

Ed *_*d L 9 python documentation python-sphinx

我正在尝试使用Sphinx来记录项目,但我无法弄清楚如何使用intersphinx.我用这行:

:py:meth:`math.sin`
Run Code Online (Sandbox Code Playgroud)

添加链接,但在输出中,它显示为粗体,而不是链接.虽然该行不起作用,但以下两者都有效:

:py:meth:`dict.items`
:py:class:`zipfile.ZipFile`
Run Code Online (Sandbox Code Playgroud)

我在conf.py文件中的intersphinx_mapping值是:

intersphinx_mapping = {'python':('http://docs.python.org/2.7', None)}
Run Code Online (Sandbox Code Playgroud)

Ed *_*d L 8

:py:meth:应该是:py:func:.基本上,可以使用任何有效的.


Fre*_*ihl 7

你有没有阅读intersphinx的文档?

编辑

用它来工作:

***
TRY
***

My try
======

sin
:py:func:`math.cos`

pop
:py:meth:`dict.pop`

dict
:py:meth:`dict.items`

zipfile
:py:class:`zipfile.ZipFile`
Run Code Online (Sandbox Code Playgroud)

阅读这里的结构交叉引用