Syntax:
#compiler-settings key = value (no quotes) #end compiler-settings #compiler-settings reset
The #compiler-settings
directive overrides Cheetah's standard settings,
changing how it parses source code and generates Python code. This
makes it possible to change the behaviour of Cheetah's parser/compiler for a
certain template, or within a portion of the template.
The reset
argument reverts to the default settings. With reset
,
there's no end tag.
Here are some examples of what you can do:
$myVar #compiler-settings cheetahVarStartToken = @ #end compiler-settings @myVar #compiler-settings reset $myVar
## normal comment #compiler-settings commentStartToken = // #end compiler-settings // new style of comment #compiler-settings reset ## back to normal comments
#slurp #compiler-settings directiveStartToken = % #end compiler-settings %slurp %compiler-settings reset #slurp
Here's a partial list of the settings you can change: