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

Am 12.01.2011 07:43, schrieb Kevin H:
> On Jan 12, 12:37 am, Kevin Horn <kevin.h...@gmail.com> wrote:
>> here is a page of output from a sphinx 
>> project:http://twistedsphinx.funsize.net/projects/web/howto/resource-template...
>>
>> here is the source of that 
>> page:http://twistedsphinx.funsize.net/_sources/projects/web/howto/resource...
>>
>> Near the end is a file included using the literalinclude directive.  As you
>> can see it is not being highlighted, though I think it should be.
>> It's just getting stuck in a <pre> tag.
>>
>> Every other literalinclude-ed file in this project works just fine.
>>
>> Things I have tried:
>>
>> * renaming the file from 'webquote.rtl' to webquote.py -- no change
>> * using the ':language: python' option on the literalinclude directive -- no
>> change
>> * messing around with line endings -- no luck
>> * messing around with html entity escaping -- no luck
>>
>> I can highlight this code with no problem using pygments' 'pygmentize'
>> command line tool, so I don't think it's a problem with pygments.
>>
>> ???
>>
>> Kevin Horn
> 
> NEVERMIND!
> 
> Apparently the process of writing my previous mail jogged my brain,
> because as soon as I'd sent it I found the problem.
> 
> The code snippet is from the PTL template language (which comes with
> the Quixote web framework), which is almost (but not quite) valid
> Python.
> 
> The problem is that PTL uses the keyword "template" rather than "def"
> when defining "functions".
> I tried replacing the template keyword with def, and bang zoom, we
> have syntax highlighting.
> 
> So now my question is:
> 
> Why will Pygments highlight this from the command line app, but not in
> Sphinx?

Python code is syntax-checked before highlighting, since it's the default
highlight language, and this way you can put other code blocks in between
without having to mark them as not-Python.

For your case, try "py3" as a highlighting language; it is not syntax-checked.

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

iEYEARECAAYFAk0tZq0ACgkQN9GcIYhpnLBe9wCfQOcJQyVOcHf+Vzyx7pGohSk/
VWUAnRBtH2m46BFQ28jKttquelG9sZN8
=op0R
-----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 sphinx-...@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to