Skip to content

Commit a3c07c5

Browse files
committed
Add phrasing fixes as recommended, reword some
1 parent e4b39db commit a3c07c5

1 file changed

Lines changed: 21 additions & 24 deletions

File tree

‎source/specifications.rst‎

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,25 @@ It is legal to specify ``Provides-Extra:`` without referencing it in any
5555
Description-Content-Type
5656
~~~~~~~~~~~~~~~~~~~~~~~~
5757

58-
A string containing the format of the distribution's description, so that tools
59-
can intelligently render the description. Historically, distribution
60-
descriptions in plain text and in `reStructuredText (reST)
61-
<http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html>`_ have
62-
been supported and PyPI knows how to render reST into HTML. It is very common
63-
for distribution authors to write their description in `Markdown
58+
A string containing the format of the distribution's description, so that
59+
tools can intelligently render the description.
60+
61+
Historically, PyPI supported descriptions in plain text and `reStructuredText
62+
(reST) <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html>`_,
63+
and could render reST into HTML. However, it is common for distribution
64+
authors to write the description in `Markdown
6465
<https://daringfireball.net/projects/markdown/>`_ (`RFC 7763
65-
<https://tools.ietf.org/html/rfc7763>`_). Distribution authors commonly use
66-
Markdown probably because that's the markup language that they are most
67-
familiar with, but PyPI historically didn't know the format of the description
68-
and thus could not know to render a description as Markdown. This results in
69-
PyPI having many packages where the description is rendered in a very ugly way,
70-
because the description was written in Markdown, but PyPI is rendering it as
71-
reST. This field allows the distribution author to specify the format of their
72-
description and thus opens up the possibility for PyPI and other tools to be
73-
able to render Markdown and other formats.
74-
75-
The format of this field is same as the ``Content-Type`` header in HTTP (e.g.:
66+
<https://tools.ietf.org/html/rfc7763>`_) as many code hosting sites render
67+
Markdown READMEs, and authors would reuse the file for the description. PyPI
68+
didn't recognize the format and so could not render the description correctly.
69+
This resulted in many packages on PyPI with poorly-rendered descriptions when
70+
Markdown is left as plain text, or worse, was attempted to be rendered as reST.
71+
This field allows the distribution author to specify the format of their
72+
description, opening up the possibility for PyPI and other tools to be able to
73+
render Markdown and other formats.
74+
75+
The format of this field is the same as the ``Content-Type`` header in HTTP
76+
(e.g.:
7677
`RFC 1341 <https://www.w3.org/Protocols/rfc1341/4_Content-Type.html>`_).
7778
Briefly, this means that it has a ``type/subtype`` part and then it can
7879
optionally have a number of parameters:
@@ -87,9 +88,9 @@ The ``type/subtype`` part has only a few legal values:
8788
- ``text/x-rst``
8889
- ``text/markdown``
8990

90-
One parameter is called ``charset``; it can be used to specify whether the
91-
character set in use is UTF-8, ASCII, etc. If ``charset`` is not provided, then
92-
it is recommended that the implementation (e.g.: PyPI) treat the content as
91+
The ``charset`` parameter can be used to specify whether the character set in
92+
use is UTF-8, ASCII, etc. If ``charset`` is not provided, then it is
93+
recommended that the implementation (e.g.: PyPI) treat the content as
9394
UTF-8.
9495

9596
Other parameters might be specific to the chosen subtype. For example, for the
@@ -105,10 +106,6 @@ the variant of Markdown in use, such as:
105106
- ``Original`` for `Gruber's original Markdown syntax
106107
<https://tools.ietf.org/html/rfc7763#section-6.1.4>`_
107108

108-
If the subtype is ``markdown`` and no ``variant`` is specified or the specfied
109-
``variant`` is not recognized, then the implementation (e.g.: PyPI) should
110-
assume that the ``variant`` is ``CommonMark``.
111-
112109
Example::
113110

114111
Description-Content-Type: text/plain; charset=UTF-8

0 commit comments

Comments
 (0)