8000 PEP 1: Make `text/x-rst` the default for the Content-Type header (#2355) · python/peps@d795805 · GitHub
[go: up one dir, main page]

Skip to content

Commit d795805

Browse files
authored
PEP 1: Make text/x-rst the default for the Content-Type header (#2355)
1 parent 9270420 commit d795805

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

pep-0001.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ The standard PEP workflow is:
208208
* The title accurately describes the content.
209209
* The PEP's language (spelling, grammar, sentence structure, etc.)
210210
and code style (examples should match :pep:`7` & :pep:`8`) should be
211-
correct and conformant. The PEP text will be automatically checked for
212-
correct reStructuredText formatting when the pull request is submitted.
211+
correct and conformant. The PEP text will be automatically checked for
212+
correct reStructuredText formatting when the pull request is submitted.
213213
PEPs with invalid reST markup will not be approved.
214214

215215
Editors are generally quite lenient about this initial review,
@@ -596,7 +596,7 @@ optional and are described below. All other headers are required.
596596
Status: <Draft | Active | Accepted | Provisional | Deferred | Rejected |
597597
Withdrawn | Final | Superseded>
598598
Type: <Standards Track | Informational | Process>
599-
* Content-Type: <text/x-rst | text/plain>
599+
* Content-Type: text/x-rst
600600
* Requires: <pep numbers>
601601
Created: <date created on, in dd-mmm-yyyy format>
602602
* Python-Version: <version number>
@@ -649,11 +649,9 @@ The Type header specifies the type of PEP: Standards Track,
649649
Informational, or Process.
650650

651651
The format of a PEP is specified with a Content-Type header.
652-
Valid values are ``text/plain`` for plaintext PEPs (see :pep:`9`)
653-
and ``text/x-rst`` for reStructuredText PEPs (see :pep:`12`).
654-
All new and active PEPs must use reStructuredText, but for backwards
655-
compatibility, plain text is currently still the default if no
656-
Content-Type header is present.
652+
All PEPs must use reStructuredText (see :pep:`12`),
653+
and have a value of ``text/x-rst``, the default.
654+
Previously, plaintext PEPs used ``text/plain`` (see :pep:`9`).
657655

658656
The Created header records the date that the PEP was assigned a
659657
number, while Post-History is used to record the dates of when new

pep-0012/pep-NNNN.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PEP-Delegate: <PEP delegate's real name>
66
Discussions-To: <REQUIRED: URL of current canonical discussion thread>
77
Status: <REQUIRED: Draft | Active | Accepted | Provisional | Deferred | Rejected | Withdrawn | Final | Superseded>
88
Type: <REQUIRED: Standards Track | Informational | Process>
9+
Content-Type: text/x-rst
910
Requires: <pep numbers>
1011
Created: <date created on, in dd-mmm-yyyy format>
1112
Python-Version: <version number>

pep2html.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def fixfile(inpath, input_lines, outfile):
260260
v = date
261261
elif k.lower() in ('content-type',):
262262
url = PEPURL % 9
263-
pep_type = v or 'text/plain'
263+
pep_type = v or 'text/x-rst'
264264
v = '<a href="%s">%s</a> ' % (url, escape(pep_type))
265265
elif k.lower() == 'version':
266266
if v.startswith('$' 'Revision: ') and v.endswith(' $'):
@@ -569,7 +569,7 @@ def fix_rst_pep(inpath, input_lines, outfile):
569569

570570
def get_pep_type(input_lines):
571571
"""
572-
Return the Content-Type of the input. "text/plain" is the default.
572+
Return the Content-Type of the input. "text/x-rst" is the default.
573573
Return ``None`` if the input is not a PEP.
574574
"""
575575
pep_type = None
@@ -579,11 +579,11 @@ def get_pep_type(input_lines):
579579
# End of the RFC 2822 header (first blank line).
580580
break
581581
elif line.startswith('content-type: '):
582-
pep_type = line.split()[1] or 'text/plain'
582+
pep_type = line.split()[1] or 'text/x-rst'
583583
break
584584
elif line.startswith('pep: '):
585585
# Default PEP type, used if no explicit content-type specified:
586-
pep_type = 'text/plain'
586+
pep_type = 'text/x-rst'
587587
return pep_type
588588

589589

0 commit comments

Comments
 (0)
0