I have set up an Intersphinx-mapping for the documentations of Python 2 and Python 3:
intersphinx_mapping = {'py2': ('http://docs.python.org/', None),
'py3': ('http://docs.python.org/3', None)}
How can I reference a class from a specific of these two resources? The documentation only mentions :ref:
erences and these two attempts do not work:
:ref:`collections.Mapping <py2:collections.Mapping>`
:class:`py3:collections.Mapping`
While this generates an expected link:
:class:`collections.Mapping`
The markup below produces working links with your intersphinx_mapping
configuration (for py2
, I suggest changing the URL to http://docs.python.org/2
to make the version explicit).
Python 2:
:class:`py2:collections.Mapping`
Python 3 (Mapping
was moved to collections.abc
in Python 3.3):
:class:`py3:collections.abc.Mapping`