Skip to content

Commit 1c6a7af

Browse files
committed
PEP 12: Extract Intersphinx section. Add example of Intersphinx reference.
1 parent 2552bd0 commit 1c6a7af

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

peps/pep-0012.rst

+21-11
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,27 @@ If you find that you need to use a backslash in your text, consider
647647
using inline literals or a literal block instead.
648648

649649

650-
Canonical Documentation and Intersphinx
651-
---------------------------------------
650+
Intersphinx
651+
-----------
652+
653+
You can use
654+
`Intersphinx references
655+
<https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html>`_
656+
to other Sphinx sites,
657+
currently the `Python documentation <https://docs.python.org/>`_
658+
`packaging.python.org <https://packaging.python.org/>`_,
659+
and `typing.readthedocs.io <https://typing.readthedocs.io/>`_,
660+
to easily cross-reference pages, sections and Python/C objects.
661+
662+
For example,
663+
to create a link pointing to a section of the typing docs,
664+
you would write the following::
665+
666+
:ref:`type expression <typing:type-expression>`
667+
668+
669+
Canonical Documentation
670+
-----------------------
652671

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

662-
Furthermore, you can use
663-
`Intersphinx references
664-
<https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html>`_
665-
to other Sphinx sites,
666-
currently the `Python documentation <https://docs.python.org/>`_
667-
and `packaging.python.org <https://packaging.python.org/>`_,
668-
to easily cross-reference pages, sections and Python/C objects.
669-
This works with both the "canonical" directives and anywhere in your PEP.
670-
671681
Add the directive between the headers and the first section of the PEP
672682
(typically the Abstract)
673683
and pass as an argument an Intersphinx reference of the canonical doc/spec

0 commit comments

Comments
 (0)