Infra: Add index by topic to PEP 0 (#2892)

* Infra: Add index by topic to PEP 0

* Infra: Move intro text

* Simplify wording
This commit is contained in:
Hugo van Kemenade 2023-03-04 10:22:14 +02:00 committed by GitHub
parent 62a0bbe95b
commit 9fa3f36d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -20,6 +20,7 @@ from pep_sphinx_extensions.pep_zero_generator.constants import STATUS_PROVISIONA
from pep_sphinx_extensions.pep_zero_generator.constants import STATUS_REJECTED
from pep_sphinx_extensions.pep_zero_generator.constants import STATUS_VALUES
from pep_sphinx_extensions.pep_zero_generator.constants import STATUS_WITHDRAWN
from pep_sphinx_extensions.pep_zero_generator.constants import SUBINDICES_BY_TOPIC
from pep_sphinx_extensions.pep_zero_generator.constants import TYPE_INFO
from pep_sphinx_extensions.pep_zero_generator.constants import TYPE_PROCESS
from pep_sphinx_extensions.pep_zero_generator.constants import TYPE_VALUES
@ -44,8 +45,7 @@ This PEP contains the index of all Python Enhancement Proposals,
known as PEPs. PEP numbers are :pep:`assigned <1#pep-editors>`
by the PEP editors, and once assigned are never changed. The
`version control history <https://github.com/python/peps>`_ of
the PEP texts represent their historical record. The PEPs are
:doc:`indexed by topic <topic/index>` for specialist subjects.
the PEP texts represent their historical record.
"""
@ -131,6 +131,15 @@ class PEPZeroWriter:
self.emit_text(intro)
self.emit_newline()
# PEPs by topic
self.emit_title("Topics")
self.emit_text("PEPs for specialist subjects are :doc:`indexed by topic <topic/index>`.")
self.emit_newline()
for subindex in SUBINDICES_BY_TOPIC:
self.emit_text(f"* `{subindex.title()} PEPs <topic/{subindex}>`_")
self.emit_newline()
self.emit_newline()
# PEPs by category
self.emit_title("Index by Category")
meta, info, provisional, accepted, open_, finished, historical, deferred, dead = _classify_peps(peps)