Skip to content

Commit 7069d80

Browse files
committed
PEP 12: Update to specify using the :pep: role to link to other PEPs
1 parent 520cf87 commit 7069d80

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

pep-0012.rst

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -475,68 +475,71 @@ Footnotes containing the URLs from external targets will be generated
475475
automatically at the end of the References section of the PEP, along
476476
with footnote references linking the reference text to the footnotes.
477477

478-
Text of the form "PEP x" or "RFC x" (where "x" is a number) will be
479-
linked automatically to the appropriate URLs.
478+
To refer to PEPs or RFCs, always use the ``:pep:`` and ``:rfc:`` roles,
479+
never hard-coded URLs.
480+
For example:
481+
482+
.. code-block:: rst
483+
484+
See :pep:`1` for more information on how to write a PEP,
485+
and :pep:`the Hyperlink section of PEP 12 <12#hyperlinks>` for how to link.
486+
487+
This renders as:
488+
489+
See :pep:`1` for more information on how to write a PEP,
490+
and :pep:`the Hyperlink section of PEP 12 <12#hyperlinks>` for how to link.
491+
492+
PEP numbers in the text are never padded, and there is a space (not a dash)
493+
between "PEP" or "RFC" and the number; the above roles will take care of
494+
that for you.
480495

481496

482497
Footnotes
483498
---------
484499

485500
Footnote references consist of a left square bracket, a number, a
486-
right square bracket, and a trailing underscore::
501+
right square bracket, and a trailing underscore
502+
503+
.. code-block:: rst
487504
488505
This sentence ends with a footnote reference [1]_.
489506
490507
Whitespace must precede the footnote reference. Leave a space between
491508
the footnote reference and the preceding word.
492509

493-
When referring to another PEP, include the PEP number in the body
494-
text, such as "PEP 1". The title may optionally appear. Add a
495-
footnote reference following the title. For example::
496-
497-
Refer to PEP 1 [2]_ for more information.
498-
499-
Add a footnote that includes the PEP's title and author. It may
500-
optionally include the explicit URL on a separate line, but only in
501-
the References section. Footnotes begin with ".. " (the explicit
510+
Footnotes begin with ".. " (the explicit
502511
markup start), followed by the footnote marker (no underscores),
503-
followed by the footnote body. For example::
512+
followed by the footnote body. For example:
513+
514+
.. code-block:: rst
504515
505516
References
506517
==========
507518
508-
.. [2] PEP 1, "PEP Purpose and Guidelines", Warsaw, Hylton
509-
(http://www.python.org/dev/peps/pep-0001)
519+
.. [1] Note that the footnote reference is a numbered one.
510520
511-
If you decide to provide an explicit URL for a PEP, please use this as
512-
the URL template::
513-
514-
http://www.python.org/dev/peps/pep-xxxx
515-
516-
PEP numbers in URLs must be padded with zeros from the left, so as to
517-
be exactly 4 characters wide; however, PEP numbers in the text are
518-
never padded.
521+
.. [2] Donald Knuth's *The TeXBook*, pages 195 and 196.
519522
520523
During the course of developing your PEP, you may have to add, remove,
521524
and rearrange footnote references, possibly resulting in mismatched
522525
references, obsolete footnotes, and confusion. Auto-numbered
523526
footnotes allow more freedom. Instead of a number, use a label of the
524527
form "#word", where "word" is a mnemonic consisting of alphanumerics
525528
plus internal hyphens, underscores, and periods (no whitespace or
526-
other characters are allowed). For example::
529+
other characters are allowed). For example:
530+
531+
.. code-block:: rst
527532
528-
Refer to PEP 1 [#PEP-1]_ for more information.
533+
Refer to The TeXBook [#TeXBook]_ for more information.
529534
530535
References
531536
==========
532537
533-
.. [#PEP-1] PEP 1, "PEP Purpose and Guidelines", Warsaw, Hylton
538+
.. [#TeXBook] Donald Knuth's *The TeXBook*, pages 195 and 196.
534539
535-
http://www.python.org/dev/peps/pep-0001
536540
537541
Footnotes and footnote references will be numbered automatically, and
538-
the numbers will always match. Once a PEP is finalized, auto-numbered
539-
labels should be replaced by numbers for simplicity.
542+
the numbers will always match.
540543

541544

542545
Images

0 commit comments

Comments
 (0)