[Catalog-sig] Syntax highlighting for code examples on PyPI
merwok at netwok.org
Mon Oct 18 14:33:50 CEST 2010
> A few lines of code in PyPI hooking up Pygments into reStructured Text
> (Pygments provides a ready made directive for this purpose) and including
> the pygments css in PyPI pages would allow this.
FTR, there are two ways to integrate reST and Sphinx: The sourcecode
pure-reST directive provided by Pygments and the code-block directive
available in Sphinx. For long_description values built from external
files that are also part of a Sphinx-made documentation, code-block can
be used but not sourcecode.
Of course, Georg knows that, being the author of both, and his plan to
use heuristics and not force any directive sounds good. On the other
hand, the directives allow one to specify the language, which can be
useful for config file examples on PyPI pages.
More information about the Catalog-SIG