Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pygments for ``.. code::`` directive PEP syntax highlighting #1206

Closed
westurner opened this issue Dec 3, 2017 · 1 comment
Closed

Add pygments for ``.. code::`` directive PEP syntax highlighting #1206

westurner opened this issue Dec 3, 2017 · 1 comment

Comments

@westurner
Copy link

@westurner westurner commented Dec 3, 2017

Syntax highlighting is an advantage for writers, editors, and readers.

reStructuredText PEPs are rendered into HTML with docutils. 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. Docutils renders .. code:: blocks with Python syntax highlighting by default. You can specify .. code:: python or .. code:: python3.

  • GitHub shows Pygments syntax highlighting
    for .. code:: directives for .rst and .restructuredtext documents
  • PEPs may eventually be hosted on ReadTheDocs with Sphinx (which installs docutils and pygments as install_requires in setup.py).
    python/peps#2
    python/core-workflow#5

In order to use pygments with pythondotorg-hosted PEPs, a few things need to happen:

  • Include pygments in base-requirements.txt
  • Pick a pygments theme
    • Should we use the sphinx_rtd_theme default for consistency with the eventual RTD-hosted PEPs?
  • Include the necessary pygments CSS in the PEPs django template
  • rebuild the PEPs
  • Start using code directives in new PEPs
  • Manually review existing PEPs after adding code directives

PEPs may use .. code:: directives instead of :: so that code is syntax highlighted.

@berkerpeksag
Copy link
Member

@berkerpeksag berkerpeksag commented Dec 3, 2017

This was rejected in #1063.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.