Re: syntax highlight

2008-09-09 Thread Georg Brandl

Pavel Kosina schrieb:
> :-D
> 
> Sorry, I forgot two things:
> 
> - mentioned that  .. highlight:: python3 helped for the example I stated
> before.
> - translation with codes: http://python.gymdom.cz/dokumentace/errors.html

You're right... recognition of doctests isn't done when using some lexer
other than "python". I'll fix this in trunk.

Georg

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: syntax highlight

2008-09-07 Thread Pavel Kosina
:-D

Sorry, I forgot two things:

- mentioned that  .. highlight:: python3 helped for the example I stated 
before.
- translation with codes: http://python.gymdom.cz/dokumentace/errors.html


Pavel



Pavel Kosina napsal(a):
> Georg Brandl napsal(a):
>> 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.
>>   
>
> It seems to doesn't work either.
> Look at this http://docs.python.org/dev/3.0/tutorial/errors.html - 
> first code is highlighted.
> And this, translation - the first code is not highlighted, even if 
> there is .. highlight:: python3, what is in English original missing
>
>
> ...we have: ./Pygments-0.11-py2.5.egg on Linux and 0.10 on Windows and 
> nothing works.
>
> Thank you for your help.
> Pavel
>
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: syntax highlight

2008-09-07 Thread Pavel Kosina
Georg Brandl napsal(a):
> 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.
>   

It seems to doesn't work either.
Look at this http://docs.python.org/dev/3.0/tutorial/errors.html - first 
code is highlighted.
And this, translation - the first code is not highlighted, even if there 
is .. highlight:: python3, what is in English original missing


...we have: ./Pygments-0.11-py2.5.egg on Linux and 0.10 on Windows and 
nothing works.

Thank you for your help.
Pavel


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: syntax highlight

2008-09-01 Thread Georg Brandl

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 sphinx-dev@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: syntax highlight

2008-08-31 Thread Pavel Kosina
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.
> Can you verify the snippet doesn't give
> a SyntaxError in a Python interpreter?
>   

No, it doesnt. It works with last  3.0

Pavel


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: syntax highlight

2008-08-30 Thread Georg Brandl

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. Can you verify the snippet doesn't give
a SyntaxError in a Python interpreter?

Georg

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com
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
-~--~~~~--~~--~--~---



syntax highlight

2008-08-29 Thread Pavel Kosina

This code:

Argumenty
-

Funkce::

def rada(napeti):
print("-- Vas kolega vas nebude ", action, end=' ')

is not syntax highlighted. Might be a bug 

Regards

-- 
Pavel Kosina 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com
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
-~--~~~~--~~--~--~---