Hash :
e063992b
Author :
Date :
2018-05-10T12:07:34
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
<h2>Comments</h2>
<pre><code class="language-tt2">[%# this entire directive is ignored no
matter how many lines it wraps onto
%]
[% # this is a comment
theta = 20 # so is this
rho = 30 # <aol>me too!</aol>
%]
</code></pre>
<h2>Variables</h2>
<pre><code class="language-tt2">[% text %]
[% article.title %]
[%= eat.whitespace.left %]
[% eat.whitespace.right =%]
[%= eat.whitespace.both =%]
[% object.method() %]</code></pre>
<h2>Conditionals and Loops</h2>
<pre><code class="language-tt2">[% IF foo = bar %]
this
[% ELSE %]
that
[% END %]
[% FOREACH post IN q.listPosts(lingua = "de") %]
<a href="[% post.permalink %]">[% post.title | html %]</a>
[% END %]</code></pre>
<h2>Multiple Directives</h2>
<pre><code class="language-tt2">[% IF title;
INCLUDE header;
ELSE;
INCLUDE other/header title="Some Other Title";
END
%]</code></pre>
<h2>Operators</h2>
<pre><code class="language-tt2">[% FOREACH post IN q.listPosts(lingua => 'de') %]
[% post.title | myfilter(foo = "bar") %]
[% END %]</code></pre>
<h2>Known Limitations</h2>
<ul>
<li><a href="http://template-toolkit.org/docs/manual/Syntax.html#section_Outline_Tags">
Outline tags</a> are not supported.</li>
<li>The arguments to
<a href="http://template-toolkit.org/docs/manual/Directives.html#section_TAGS">TAGS</a>
are usually misinterpreted</li>
<li>In TT2, you can use keywords as identifiers where this is
unambiguous. But these keywords will be highlighted as keywords, not
as variables here.</li>
<li>The
<a href="http://template-toolkit.org/docs/manual/Config.html#section_ANYCASE">ANYCASE</a>
option is not supported.</li>
<li>
Any number of backslashes in front of dollar signs inside of double quoted
strings are ignored since the behavior of Template Toolkit 2.26 seems to be
inconsistent.
</li>
</ul>