Paste the following in any node to see Python colorizing. It will look 
different from the github colors below ;-)

@ A doc part.  *All* languages colorize doc parts as follows:

1. The '@' sign itself is colored with @color leokeyword constant.

2. The rest of the doc parts depends on the @bool color-doc-parts-as-rest 
setting:
   True:  Colorize the doc part as **markdown**.
   False: Colorize the doc part using @color docpart.
   
Leo colorizes constructs with two kinds of color constants.
- **Default colors** defined in the node "Colors: defaults".
  These constants correspond to jEdit names used in leo/modes/*.py.
  See the "Colors: defaults" node for more details.
- **Leo-specific colors**, defined in the node "Colors: Leo constructs".
  
Most languages use only a subset of these color names.
Here are all the colors used to color python:
@c # @color leo_keyword_color

# Comments: @color comment1

def spam():
    
    # Reserved words...
    pass     # Python keywords: @color keyword1
    abs(1)   # Standard functions: @color keyword2.
    __file__ # double underscore names: @color keyword3
    try:
        frobnicate() # Function calls are not specially colored.
    except IOError: # Exception names: @color keyword3
        pass
    a = 2    # Operators (the = sign): @color operator_color
    
    # Strings...
    a = 'Regular string' # @color literal1
    '''Triple single-quoted docstring''' # @color literal2
    """Triple double-quoted docstring""" # @color literal2
    
# All languages use the following names...
    
# Urls: http://leoeditor.com/  @color url_color
<< undefined section >>      # @color undefined_section_name_color
<< defined section >>
    # The brackets:            @color section_name_brackets_color
    # The section name itself: @color section_name_color
    
@language python # @color leo_keyword_color

Please report any missing items.  Python is a good start, but other 
templates might be useful.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to