Does anybody know how to have syntax highlighting for Cython code in
Sage? Clearly the code exists, because the official Cython
documentation (see for example
http://docs.cython.org/src/tutorial/external.html) is properly syntax
highlighted. So either this is not included in Sage or it is but I
don't know how to enable it.
Thanks,
Jeroen.
You can do
.. code-block:: cython
cdef i
See http://sphinx.pocoo.org/markup/code.html for more info.
--Mike
That doesn't work for me with the version of Sphinx in sage-4.6.alpha3.
It just literally writes the text
".. code-block:: cython" in the output...
This doesn't actually solve the problem: Sphinx 1.0.4 still doesn't know
about Cython.
Robert: how does the Cython project generate its documentation?
Sorry, I was too quick. The syntax highlighting is done by Pygments (as
you suggested), Sphinx actually Pygments to do the highlighting.
So we need to upgrade Pygments (which is hopefully easy, since it's pure
Python without any patches), see #10290.
Jeroen.