Skip to content

PEP 12: Extract Intersphinx section. Add example of Intersphinx reference. #3827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions peps/pep-0012.rst
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,27 @@ If you find that you need to use a backslash in your text, consider
using inline literals or a literal block instead.


Canonical Documentation and Intersphinx
---------------------------------------
Intersphinx
-----------

You can use
`Intersphinx references
<https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html>`_
to other Sphinx sites,
such as the `Python documentation <https://docs.python.org/>`_
`packaging.python.org <https://packaging.python.org/>`_,
and `typing.readthedocs.io <https://typing.readthedocs.io/>`_,
to easily cross-reference pages, sections and Python/C objects.

For example,
to create a link pointing to a section of the typing docs,
you would write the following::

:ref:`type expression <typing:type-expression>`


Canonical Documentation
-----------------------

As :pep:`PEP 1 describes <1#pep-maintenance>`,
PEPs are considered historical documents once marked Final,
Expand All @@ -659,15 +678,6 @@ or an appropriate subclass:
* ``canonical-pypa-spec`` for packaging standards
* ``canonical-typing-spec`` for typing standards

Furthermore, you can use
`Intersphinx references
<https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html>`_
to other Sphinx sites,
currently the `Python documentation <https://docs.python.org/>`_
and `packaging.python.org <https://packaging.python.org/>`_,
to easily cross-reference pages, sections and Python/C objects.
This works with both the "canonical" directives and anywhere in your PEP.

Add the directive between the headers and the first section of the PEP
(typically the Abstract)
and pass as an argument an Intersphinx reference of the canonical doc/spec
Expand Down