Pavel Kosina schrieb:
> Georg Brandl napsal(a):
>> Pavel Kosina schrieb:
>>
>>> This code:
>>>
>>> Argumenty
>>> -----------------------------
>>>
>>> Funkce::
>>>
>>> def rada(napeti):
>>> print("-- Vas kolega vas nebude ", action, end=' ')
>>>
>>> is not syntax highlighted. Might be a bug ....
>>>
>>
>> I can't reproduce that here.
>
> When you save it in a rst file and run over it sphinx - then you can see
> the snippet highlited?? The "def" is bold green at you? Not me :-( And
> this is just one snippet of many on one page. Some are highlited others
> arent.
You are quite right, I overlooked the "end=' '".
Sphinx' default behavior is to parse Python snippets to determine if they're
valid Python. If they aren't, they are not highlighted. This is done since
code blocks are by default highlighted; and the parsing usually serves well
determining if a snippet is really Python.
Of course, this makes not much sense with Python 3 code highlighted by a
Python 2-run Sphinx. If you use Pygments >= 0.10, you can set
.. highlight:: python3
to use the Python 3 lexer and not parse code before highlighting.
Georg
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---