<div>Add pygments for ``.. code::`` directive PEP syntax highlighting #1206</div><div><a href="https://github.com/python/pythondotorg/issues/1206">https://github.com/python/pythondotorg/issues/1206</a></div><div><br></div><div>Syntax highlighting is an advantage for writers, editors, and readers.</div><div><br></div><div>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``.</div><div><br></div><div>- GitHub shows Pygments syntax highlighting</div><div>for ``.. code::`` directives for .rst and .restructuredtext documents</div><div>- PEPs may eventually be hosted on ReadTheDocs with Sphinx (which installs docutils and pygments as install_requires in setup.py).</div><div> <a href="https://github.com/python/peps/issues/2">https://github.com/python/peps/issues/2</a></div><div> <a href="https://github.com/python/core-workflow/issues/5">https://github.com/python/core-workflow/issues/5</a></div><div><br></div><div>In order to use pygments with pythondotorg-hosted PEPs, a few things need to happen:</div><div><br></div><div>- [ ] Include ``pygments`` in ``base-requirements.txt``</div><div>- [ ] Pick a pygments theme</div><div> - Should we use the sphinx_rtd_theme default for consistency with the eventual RTD-hosted PEPs?</div><div>- [ ] Include the necessary pygments CSS in the PEPs django template</div><div>- [ ] rebuild the PEPs</div><div>- Start using code directives in new PEPs</div><div>- Manually review existing PEPs after adding code directives</div><div><br></div><div>PEPs may use ``.. code::`` blocks instead of ``::`` so that code is syntax highlighted.</div><br>On Saturday, December 2, 2017, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 3 December 2017 at 12:32, Wes Turner <<a href="javascript:;" onclick="_e(event, 'cvml', 'wes.turner@gmail.com')">wes.turner@gmail.com</a>> wrote:<br>
> Pending a transition of PEPs to ReadTheDocs (with HTTPS on a custom domain?<br>
> and redirects?) (is there a gh issue for this task?),<br>
<br>
See <a href="https://github.com/python/peps/projects/1" target="_blank">https://github.com/python/<wbr>peps/projects/1</a> and<br>
<a href="https://github.com/python/core-workflow/issues/5" target="_blank">https://github.com/python/<wbr>core-workflow/issues/5</a><br>
<br>
Cheers,<br>
Nick.<br>
<br>
--<br>
Nick Coghlan | <a href="javascript:;" onclick="_e(event, 'cvml', 'ncoghlan@gmail.com')">ncoghlan@gmail.com</a> | Brisbane, Australia<br>
</blockquote>