-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 20.03.2010 10:40, schrieb Spot:
> I'm using Sphinx to document an internal API. Perhaps there is
> something I am doing wrong, but I cannot seem to get any PHP code to
> syntax highlight.
> 
> I've used:
> 
> ..  highlight:: php
> 
> and also
> 
> ..  code-block:: php
> 
> neither work.
> 
> If I use 'guess' with code-block I get a little highlighting, but not
> much at all.
> 
> What am I doing wrong? (Yes, Pygments is installed)

The Pygments PHP lexer requires PHP code to be between "<?php" "?>"
delimiters.  You can override this with the "startinline" option, but
there is currently no way to pass Pygments lexer options from Sphinx.

The following hack should work though (put it in conf.py):

   from sphinx.highlighting import lexers
   from pygments.lexers.web import PhpLexer
   lexers['php'] = PhpLexer(startinline=True)

cheers,
Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iEYEARECAAYFAku4yPMACgkQN9GcIYhpnLAr1ACdH6AVNjtz6wls6cR37EbgGQWU
TpYAoK9wiuqziNsk+vPni5HbLOs3+pP+
=YTj7
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to