<--previous | contents | next-->

Cheat Sheet

The Temp Class

The Temp class should be instantiated as follows:

Temp(input, **kwargs)

Where "input" is a raw template.

The File Class

As for the Temp, but the path to a template is passed instead of raw template data:

File(path, **kwargs)

Calling Templates and Blocks

Templates and blocks can be called with a set of over-ride arguments.

x = File(path, foo=1) x(foo=2)

The templating language

Substitution

@!escaped-expression!@

$!unescaped-expression!$

Block Types

Raw:

        <!--(raw)-->
            @!expression!@
        <!--(end)-->


Named:

        <!--(block blockName)-->
            @!expression!@
        <!--(end)-->


Repeat:

        <!--(for item in listItem)-->
            @!item!@
        <!--(end)-->


Block Flavours

Fully commented:

        <!--(raw)-->
            @!expression!@
        <!--(end)-->


Half commented:

        <!--(raw)
            @!expression!@
        (end)-->


Conditionals

@!if cond then positive else negative!@


<--previous | contents | next--> (11/16/04)
Cubictemp v0.4 Manual