File: prism-tt2.html

package info (click to toggle)
node-prismjs 1.30.0%2Bdfsg%2B~1.26.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,220 kB
  • sloc: javascript: 27,628; makefile: 9; sh: 7; awk: 4
file content (61 lines) | stat: -rw-r--r-- 1,871 bytes parent folder | download | duplicates (3)
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      # &lt;aol&gt;me too!&lt;/aol&gt;
%]
</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") %]
  &lt;a href="[% post.permalink %]"&gt;[% post.title | html %]&lt;/a&gt;
[% 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>