|
Re: Custom Directive Delimiter: msg#00045python.cheetah
Alex J. Champandard wrote: I'm trying code generation with Cheetah. I have to say it's a pleasure compared to XSLT! ;) Yes, it most certainly is! One thing that would help is replacing the default '#' directive tag. It'd save me the worry of escaping all my C++ \#include if I could set Cheetah to @include instead.... How is this done? I can't find much on the subject in the documentation. It's in section 11.2 of the manual, "#compiler-settings". What you want is "directiveStartToken". You can use it in a template like so: #compiler-settings directiveStartToken = @ #end compiler-settings @def foo some stuff @end def Or better yet, you can add a compilerSettings argument when instantiating a Template object, like so: t = Template(text, compilerSettings={'directiveStartToken' : '@'}) Enjoy! ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Custom Directive Delimiter, Tavis Rudd |
|---|---|
| Next by Date: | Re: Modular Temptales, Alex J. Champandard |
| Previous by Thread: | Re: Custom Directive Delimiter, Aaron Held |
| Next by Thread: | Re: Modular Temptales, Alex J. Champandard |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |