Package gluon :: Module html :: Class CODE
[hide private]
[frames] | no frames]

Class CODE

source code

  object --+        
XmlComponent --+    
             DIV --+

Displays code in HTML with syntax highlighting.

    language: indicates the language, otherwise PYTHON is assumed
    link: can provide a link
    styles: for styles


{{=CODE("print 'hello world'", language='python', link=None,
    counter=1, styles={}, highlight_line=None)}}

supported languages are

    "python", "html_plain", "c", "cpp", "web2py", "html"

The "html" language interprets {{ and }} tags as "web2py" code,
"html_plain" doesn't.

if a link='/examples/global/vars/' is provided web2py keywords are linked to
the online docs.

the counter is used for line numbering, counter can be None or a prompt

Instance Methods [hide private]
generates the xml for this component.
source code

Inherited from DIV: __delitem__, __getitem__, __init__, __len__, __nonzero__, __setitem__, __str__, append, element, elements, flatten, insert, sibling, siblings, update

Inherited from XmlComponent: __add__, __mul__, add_class, remove_class

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]

Inherited from DIV: regex_attr, regex_class, regex_id, regex_tag, tag

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]


source code 

generates the xml for this component.

Overrides: XmlComponent.xml