8000 PEP 12: Implement reviewer feedback and make further improvements · python/peps@bdee439 · GitHub
[go: up one dir, main page]

Skip to content

Commit bdee439

Browse files
committed
PEP 12: Implement reviewer feedback and make further improvements
1 parent 42e7d3b commit bdee439

File tree

5 files changed

+20
-39
lines changed

5 files changed

+20
-39
lines changed

pep-0001.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,8 @@ Each PEP should have the following parts/sections:
509509
ready for consideration are complete and reduces people duplicating
510510
prior discussion.
511511

512-
12. Footnotes -- A collection of footnotes referenced in the PEP, and
513-
a central place to list non-inline hyperlink targets.
512+
12. Footnotes -- A collection of footnotes cited in the PEP, and
513+
a place to list non-inline hyperlink targets.
514514

515515
13. Copyright/license -- Each new PEP must be placed under a dual license of
516516
public domain and CC0-1.0-Universal_ (see this PEP for an example).

pep-0012.rst

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Post-History: 30-Aug-2002
1212

1313
.. note::
1414
For those who have written a PEP before, there is a template_
15-
(which is included as a file in the PEPs repository).
15+
(which is included as a file in the `PEPs repository`_).
1616

1717
Abstract
1818
========
@@ -469,8 +469,6 @@ which displays as:
469469

470470
Visit the `website <https://www.python.org/>`__ for more.
471471

472-
.. _Python web site: https://www.python.org/
473-
474472
If you want to use one link multiple places with different linked text,
475473
or want to ensure you don't have to update your link target names when
476474
changing the linked text, include the target name within angle brackets
@@ -542,12 +540,17 @@ that for you.
542540
Footnotes
543541
---------
544542

545-
Footnote references consist of a left square bracket, a number, a
546-
right square bracket, and a trailing underscore:
543+
Footnote references consist of a left square bracket, a label, a
544+
right square bracket, and a trailing underscore.
545+
Instead of a number, use a label of the
546+
form "#word", where "word" is a mnemonic consisting of alphanumerics
547+
plus internal hyphens, underscores, and periods (no whitespace or
548+
other characters are allowed).
549+
For example:
547550

548551
.. code-block:: rst
549552
550-
This sentence ends with a footnote reference [1]_.
553+
Refer to The TeXbook [#TeXbook]_ for more information.
551554
552555
Whitespace must precede the footnote reference. Leave a space between
553556
the footnote reference and the preceding word.
@@ -566,28 +569,8 @@ followed by the footnote body. For example:
566569
Footnotes
567570
=========
568571
569-
.. [1] Note that the footnote reference is a numbered one.
570-
571-
.. [2] Donald Knuth's *The TeXbook*, pages 195 and 196.
572-
573-
During the course of developing your PEP, you may have to add, remove,
574-
and rearrange footnote references, possibly resulting in mismatched
575-
references, obsolete footnotes, and confusion. Auto-numbered
576-
footnotes allow more freedom. Instead of a number, use a label of the
577-
form "#word", where "word" is a mnemonic consisting of alphanumerics
578-
plus internal hyphens, underscores, and periods (no whitespace or
579-
other characters are allowed). For example:
580-
581-
.. code-block:: rst
582-
583-
Refer to The TeXbook [#TeXbook]_ for more information.
584-
585-
Footnotes
586-
=========
587-
588572
.. [#TeXbook] Donald Knuth's *The TeXbook*, pages 195 and 196.
589573
590-
591574
Footnotes and footnote references will be numbered automatically, and
592575
the numbers will always match.
593576

pep-0012/pep-NNNN.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Open Issues
7878
Footnotes
7979
=========
8080

81-
[A collection of footnotes referenced in the PEP, and a central place to list non-inline hyperlink targets.]
81+
[A collection of footnotes cited in the PEP, and a place to list non-inline hyperlink targets.]
8282

8383

8484
Copyright

pep2html.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,14 +510,13 @@ def apply(self):
510510
for section in reversed(self.document):
511511
if not isinstance(section, nodes.section):
512512
continue
513-
title_words = section[0].astext().lower().split()
514-
if 'references' in title_words or 'footnotes' in title_words:
515-
# Remove references/footnotes section if there are no displayed
516-
# footnotes (it only has title & link target nodes)
513+
title_words = {*section[0].astext().lower().split()}
514+
if {"references", "footnotes"} & title_words:
515+
# Remove references/footnotes sections if there is no displayed
516+
# content (i.e. they only have title & link target nodes)
517517
if all(isinstance(ref_node, (nodes.title, nodes.target))
518518
for ref_node in section):
519519
section.parent.remove(section)
520-
break
521520

522521

523522
class PEPReader(standalone.Reader):

pep_sphinx_extensions/pep_processor/transforms/pep_footer.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def apply(self) -> None:
3030
for section in reversed(self.document[0]):
3131
if not isinstance(section, nodes.section):
3232
continue
33-
title_words = section[0].astext().lower().split()
34-
if "references" in title_words or "footnotes" in title_words:
35-
# Remove references/footnotes section if there are no displayed
36-
# footnotes (it only has title & link target nodes)
33+
title_words = {*section[0].astext().lower().split()}
34+
if {"references", "footnotes"} & title_words:
35+
# Remove references/footnotes sections if there is no displayed
36+
# content (i.e. they only have title & link target nodes)
3737
to_hoist = []
3838
types = set()
3939
for node in section:
@@ -43,7 +43,6 @@ def apply(self) -> None:
4343
if types <= {nodes.title, nodes.target}:
4444
section.parent.extend(to_hoist)
4545
section.parent.remove(section)
46-
break
4746

4847
# Add link to source text and last modified date
4948
if pep_source_path.stem != "pep-0000":

0 commit comments

Comments
 (0)
0