<--previous | contents | next-->

Raw Blocks

It sometimes happens that we have a piece of text that has two @ or $ symbols on the same line. If we just passed this text into Cubictemp, it would try to evaluate the text between the two symbols as a Python expression. This is likely to cause an exception, and would certainly not produce the output we expect. The answer to this problem is to wrap the piece of text in a raw block. This tells Cubictemp that it should not be interpreted, but rather that it should be inserted in the rendered document untouched:

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

The directives starting and ending a block are removed from the final output. The template above would therefore result in output like this:

    @!bar!@

A raw block ends at a matching "end" directive. This means that a raw block can contain well-formed CubicTemp template code, as long as each block start has a corresponding block end. For instance, this is a valid raw block:

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

Which renders to the following:

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


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