From experience writing a lot of code-generation sorts of templates (e.g. generating C++ or C# code, not HTML "code"), a useful variation of this feature is to allow a block to have whitespace compressed similar to HTML's rules, allowing markup like:
which would produce (for name=foo and is_string=true and value=bar)
var foo = "bar";
The ability to strip out the line of any control tag (if/else/end) that is nothing but whitespace is also useful to avoid a bunch of empty lines showing up in the output.
It's also handy to have a way to output the current input line number and filename so you can insert #line tags and the like.
From experience writing a lot of code-generation sorts of templates (e.g. generating C++ or C# code, not HTML "code"), a useful variation of this feature is to allow a block to have whitespace compressed similar to HTML's rules, allowing markup like:
which would produce (for name=foo and is_string=true and value=bar)
The ability to strip out the line of any control tag (if/else/end) that is nothing but whitespace is also useful to avoid a bunch of empty lines showing up in the output.
It's also handy to have a way to output the current input line number and filename so you can insert
#line
tags and the like.