Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I put an intersphinx link to an arbitrary method in the standard library documentation?

I am trying to use Sphinx to document a project, but I cannot figure out how to use intersphinx. I use this line:

:py:meth:`math.sin`

to add the link, but in the output, it shows up bold, not as a link. Although that line does not work, both the following do:

:py:meth:`dict.items`
:py:class:`zipfile.ZipFile`

My intersphinx_mapping value in the conf.py file is:

intersphinx_mapping = {'python':('http://docs.python.org/2.7', None)}
like image 994
Ed L Avatar asked May 25 '11 19:05

Ed L


2 Answers

The :py:meth: should be :py:func:. Basically, any valid domain can be used.

like image 83
Ed L Avatar answered Nov 07 '22 22:11

Ed L


Have you read the documentation for intersphinx?

Edit

Got it to work using this:

***
TRY
***

My try
======

sin
:py:func:`math.cos`

pop
:py:meth:`dict.pop`

dict
:py:meth:`dict.items`

zipfile
:py:class:`zipfile.ZipFile`

Read about the constructs here crossreference

like image 7
Fredrik Pihl Avatar answered Nov 07 '22 22:11

Fredrik Pihl