PEP 1 and 12: Document Topic header (#2995)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
This commit is contained in:
Hugo van Kemenade 2023-02-03 21:34:17 +02:00 committed by GitHub
parent 7e1d4a5ae5
commit e92c4d6afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 0 deletions

View File

@ -11,6 +11,11 @@ RENDER_COMMAND=$(VENVDIR)/bin/python3 build.py -j $(JOBS) -o $(OUTPUT_DIR)
html: venv html: venv
$(RENDER_COMMAND) $(RENDER_COMMAND)
## htmlview to open the index page built by the html target in your browser
.PHONY: htmlview
htmlview: html
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/index.html'))"
## dirhtml to render PEPs to "index.html" files within "pep-NNNN" directories ## dirhtml to render PEPs to "index.html" files within "pep-NNNN" directories
.PHONY: dirhtml .PHONY: dirhtml
dirhtml: venv rss dirhtml: venv rss

View File

@ -39,6 +39,17 @@ resource "fastly_service_vcl" "peps" {
EOT EOT
} }
snippet {
name = "topics"
type = "recv"
content = <<-EOT
if (req.url ~ "^/topics($|/)") {
set req.http.Location = regsub(req.http.Location, "^/topics/?", "/topic/");
error 618;
}
EOT
}
snippet { snippet {
name = "redirect" name = "redirect"
type = "error" type = "error"

View File

@ -605,6 +605,7 @@ optional and are described below. All other headers are required.
Status: <Draft | Active | Accepted | Provisional | Deferred | Rejected | Status: <Draft | Active | Accepted | Provisional | Deferred | Rejected |
Withdrawn | Final | Superseded> Withdrawn | Final | Superseded>
Type: <Standards Track | Informational | Process> Type: <Standards Track | Informational | Process>
* Topic: <Governance | Packaging | Release | Typing>
* Content-Type: text/x-rst * Content-Type: text/x-rst
* Requires: <pep numbers> * Requires: <pep numbers>
Created: <date created on, in dd-mmm-yyyy format> Created: <date created on, in dd-mmm-yyyy format>
@ -659,6 +660,10 @@ archives, rather than just a mailto: or hyperlink to the list itself.
The Type header specifies the type of PEP: Standards Track, The Type header specifies the type of PEP: Standards Track,
Informational, or Process. Informational, or Process.
The optional Topic header lists the special topic, if any,
the PEP belongs under.
See the :ref:`topic-index` for the existing topics.
The format of a PEP is specified with a Content-Type header. The format of a PEP is specified with a Content-Type header.
All PEPs must use reStructuredText (see :pep:`12`), All PEPs must use reStructuredText (see :pep:`12`),
and have a value of ``text/x-rst``, the default. and have a value of ``text/x-rst``, the default.

View File

@ -121,6 +121,9 @@ directions below.
Python-Version: 2.2 Python-Version: 2.2
- Add a Topic header if the PEP belongs under one shown at the :ref:`topic-index`.
Most PEPs don't.
- Leave Post-History alone for now; you'll add dates and corresponding links - Leave Post-History alone for now; you'll add dates and corresponding links
to this header each time you post your PEP to the designated discussion forum to this header each time you post your PEP to the designated discussion forum
(and update the Discussions-To header with said link, as above). (and update the Discussions-To header with said link, as above).
@ -174,6 +177,7 @@ your PEP):
Discussions-To: [URL] Discussions-To: [URL]
Status: Draft Status: Draft
Type: [Standards Track | Informational | Process] Type: [Standards Track | Informational | Process]
Topic: *[Governance | Packaging | Release | Typing]
Content-Type: text/x-rst Content-Type: text/x-rst
Requires: *[NNN] Requires: *[NNN]
Created: [DD-MMM-YYYY] Created: [DD-MMM-YYYY]

View File

@ -6,6 +6,7 @@ PEP-Delegate: <PEP delegate's real name>
Discussions-To: <REQUIRED: URL of current canonical discussion thread> Discussions-To: <REQUIRED: URL of current canonical discussion thread>
Status: <REQUIRED: Draft | Active | Accepted | Provisional | Deferred | Rejected | Withdrawn | Final | Superseded> Status: <REQUIRED: Draft | Active | Accepted | Provisional | Deferred | Rejected | Withdrawn | Final | Superseded>
Type: <REQUIRED: Standards Track | Informational | Process> Type: <REQUIRED: Standards Track | Informational | Process>
Topic: <Governance | Packaging | Release | Typing>
Content-Type: text/x-rst Content-Type: text/x-rst
Requires: <pep numbers> Requires: <pep numbers>
Created: <date created on, in dd-mmm-yyyy format> Created: <date created on, in dd-mmm-yyyy format>

View File

@ -57,6 +57,8 @@ the PEP index.
def generate_topic_contents(docnames: list[str], env: BuildEnvironment): def generate_topic_contents(docnames: list[str], env: BuildEnvironment):
update_sphinx("topic/index", """\ update_sphinx("topic/index", """\
.. _topic-index:
Topic Index Topic Index
*********** ***********