我正在尝试将外部API的交叉引用添加到我的文档中,但我面临三种不同的行为.
我正在使用sphinx(1.3.1)和Python(2.7.3),我的intersphinx映射配置为:
{
'python': ('https://docs.python.org/2.7', None),
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'cv2' : ('http://docs.opencv.org/2.4/', None),
'h5py' : ('http://docs.h5py.org/en/latest/', None)
}
Run Code Online (Sandbox Code Playgroud)
我可以毫不费力地编写numpy API的交叉引用,:class:`numpy.ndarray`或者:func:`numpy.array`像我们预期的那样给我一些像numpy.ndarray这样的东西.
但是,使用h5py,我可以生成链接的唯一方法是省略模块名称.例如,:class:`Group`(或:class:`h5py:Group`)给我Group但:class:`h5py.Group`无法生成链接.
最后,我找不到一种方法来编写一个工作交叉引用OpenCV API,这些似乎都没有工作:
:func:`cv2.convertScaleAbs`
:func:`cv2:cv2.convertScaleAbs`
:func:`cv2:convertScaleAbs`
:func:`convertScaleAbs`
Run Code Online (Sandbox Code Playgroud)
如何正确编写对外部API的交叉引用,或配置intersphinx,以便在numpy情况下生成链接?