Back to Prismjs

Prism Tt2

examples/prism-tt2.html

latest1.5 KB
Original Source

Comments

[%# 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>
%]

Variables

[% text %]
[% article.title %]
[%= eat.whitespace.left %]
[% eat.whitespace.right =%]
[%= eat.whitespace.both =%]
[% object.method() %]

Conditionals and Loops

[% IF foo = bar %]
this
[% ELSE %]
that
[% END %]
[% FOREACH post IN q.listPosts(lingua = "de") %]
  <a href="[% post.permalink %]">[% post.title | html %]</a>
[% END %]

Multiple Directives

[% IF title;
      INCLUDE header;
   ELSE;
      INCLUDE other/header title="Some Other Title";
   END
%]

Operators

[% FOREACH post IN q.listPosts(lingua => 'de') %]
  [% post.title | myfilter(foo = "bar") %]
[% END %]

Known Limitations

  • Outline tags are not supported.
  • The arguments to TAGS are usually misinterpreted
  • In TT2, you can use keywords as identifiers where this is unambiguous. But these keywords will be highlighted as keywords, not as variables here.
  • The ANYCASE option is not supported.
  • 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.