[Python-Dev] PEPs: .. code:: python
or ::
(syntax highlighting) (original) (raw)
Wes Turner wes.turner at gmail.com
Thu Nov 30 08:00:10 EST 2017
- Previous message (by thread): [Python-Dev] Third and hopefully final post: PEP 557, Data Classes
- Next message (by thread): [Python-Dev] Py_DECREF(m) on PyInit_xxx() failure?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In ReStructuredText, this gets syntax highlighted because of the code directive [1][2][3]:
.. code:: python
import this def func(*args, **kwargs): pass
This also gets syntax highlighted as python[3]:
.. code:: python
import this def func(*args, **kwargs): pass
This does not::
import this def func(*args, **kwargs): pass
Syntax highlighting in Docutils 0.9+ is powered by Pygments. If Pygments is not installed, or there is a syntax error, syntax highlighting is absent.
GitHub does show Pygments syntax highlighting in .. code:: blocks for .rst and .restructuredtext documents [4]
- Does the python.org PEP view support .. code:: blocks? [5]
- Syntax highlighting is an advantage for writers, editors, and readers.
- Should PEPs use .. code:: blocks to provide this advantage?
[1] http://docutils.sourceforge.net/docs/ref/rst/directives.html#code [2] http://www.sphinx-doc.org/en/stable/markup/code.html [3] http://www.sphinx-doc.org/en/stable/config.html#confval-highlight_language [4] https://github.com/python/peps/blob/master/pep-0557.rst [5] https://www.python.org/dev/peps/pep-0557/
https://www.python.org/dev/peps/pep-0458/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20171130/f6246108/attachment.html>
- Previous message (by thread): [Python-Dev] Third and hopefully final post: PEP 557, Data Classes
- Next message (by thread): [Python-Dev] Py_DECREF(m) on PyInit_xxx() failure?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]