velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1843798 - in /velocity/site/production/engine/devel: changes.html developer-guide.html user-guide.html vtl-reference.html
Date Sat, 13 Oct 2018 22:32:15 GMT
Author: cbrisson
Date: Sat Oct 13 22:32:15 2018
New Revision: 1843798

URL: http://svn.apache.org/viewvc?rev=1843798&view=rev
Log:
[site/engine] Document alternate values (and other minor fixes) => prod

Modified:
    velocity/site/production/engine/devel/changes.html
    velocity/site/production/engine/devel/developer-guide.html
    velocity/site/production/engine/devel/user-guide.html
    velocity/site/production/engine/devel/vtl-reference.html

Modified: velocity/site/production/engine/devel/changes.html
URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/changes.html?rev=1843798&r1=1843797&r2=1843798&view=diff
==============================================================================
--- velocity/site/production/engine/devel/changes.html (original)
+++ velocity/site/production/engine/devel/changes.html Sat Oct 13 22:32:15 2018
@@ -236,6 +236,11 @@ h2:hover > .headerlink, h3:hover > .head
     </thead>
     <tbody>
       <tr>
+        <td>2.1</td>
+        <td>In subversion</td>
+        <td/>
+      </tr>
+      <tr>
         <td>2.0</td>
         <td>2017-08-06</td>
         <td/>
@@ -303,7 +308,54 @@ h2:hover > .headerlink, h3:hover > .head
     </tbody>
   </table>
 </p>
-<h3>Release 2.0 - 2017-08-06</h3><p>
+<h3>Release 2.1 - In subversion</h3><p>
+  <table class="standard">
+    <thead>
+      <tr>
+        <th>Type</th>
+        <th>Changes</th>
+        <th>Bye</th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td>
+          <img src="images/add.png"/>
+        </td>
+        <td> Alternate reference values: <code> ${foo|'foo'} </code> evaluates
to false whenever boolean evaluation of $foo is false . Fixes <a href="https://issues.apache.org/jira/browse/VELOCITY-898">VELOCITY-898</a>.
</td>
+        <td>cbrisson</td>
+      </tr>
+      <tr>
+        <td>
+          <img src="images/fix.png"/>
+        </td>
+        <td> Fix parser regression in #macro whitespaces handling . Fixes <a href="https://issues.apache.org/jira/browse/VELOCITY-889">VELOCITY-889</a>.
</td>
+        <td>cbrisson</td>
+      </tr>
+      <tr>
+        <td>
+          <img src="images/add.png"/>
+        </td>
+        <td> Added a new 'parser.allows.dash.in.identifiers' boolean property (false
per default) to (dis)allow '-' in reference identifiers . Fixes <a href="https://issues.apache.org/jira/browse/VELOCITY-542">VELOCITY-542</a>.
</td>
+        <td>cbrisson</td>
+      </tr>
+      <tr>
+        <td>
+          <img src="images/fix.png"/>
+        </td>
+        <td> Fix parsing of a terminal hash or dollar sign in sing litteral and template
. Fixes <a href="https://issues.apache.org/jira/browse/VELOCITY-896">VELOCITY-896</a>.
</td>
+        <td>cbrisson</td>
+      </tr>
+      <tr>
+        <td>
+          <img src="images/fix.png"/>
+        </td>
+        <td> Implicit conversion to numbers in integer ranges . Fixes <a href="https://issues.apache.org/jira/browse/VELOCITY-895">VELOCITY-895</a>.
</td>
+        <td>cbrisson</td>
+      </tr>
+    </tbody>
+  </table>
+</p><h3>Release 2.0 - 2017-08-06</h3><p>
   <table class="standard">
     <thead>
       <tr>

Modified: velocity/site/production/engine/devel/developer-guide.html
URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/developer-guide.html?rev=1843798&r1=1843797&r2=1843798&view=diff
==============================================================================
--- velocity/site/production/engine/devel/developer-guide.html (original)
+++ velocity/site/production/engine/devel/developer-guide.html Sat Oct 13 22:32:15 2018
@@ -1107,6 +1107,7 @@ see the Javadoc API documentation.</p>
 </pre></div>
 
 
+<p>When a reference has an alternate value provided, as in <code>${foo.bar|'foo'}</code>,
whenever <code>$foo.bar</code> is invalid, the invalid reference handler is called
<strong>before</strong> the alternate value (and the alternate value will be used
only if the value returned by the handler evaluates to null, false, empty or zero).</p>
 <p>Available implementations include:</p>
 <ul>
 <li><code>org.apache.velocity.app.event.implement.ReportInvalidReferences</code></li>

Modified: velocity/site/production/engine/devel/user-guide.html
URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/user-guide.html?rev=1843798&r1=1843797&r2=1843798&view=diff
==============================================================================
--- velocity/site/production/engine/devel/user-guide.html (original)
+++ velocity/site/production/engine/devel/user-guide.html Sat Oct 13 22:32:15 2018
@@ -246,6 +246,7 @@ h2:hover > .headerlink, h3:hover > .head
 </ul>
 </li>
 <li><a href="#formal-reference-notation">Formal Reference Notation</a></li>
+<li><a href="#alternate-values">Alternate values</a></li>
 <li><a href="#quiet-reference-notation">Quiet Reference Notation</a></li>
 <li><a href="#strict-reference-mode">Strict Reference Mode</a></li>
 <li><a href="#case-substitution">Case Substitution</a></li>
@@ -541,6 +542,13 @@ h2:hover > .headerlink, h3:hover > .head
 
 
 <p>Now Velocity knows that <em>$vice</em>, not <em>$vicemaniac</em>,
is the reference. Formal notation is often useful when references are directly adjacent to
text in a template.</p>
+<h2 id="alternate-values">Alternate values<a class="headerlink" href="#alternate-values"
title="Permanent link">&para;</a></h2>
+<p>Formal reference notations can also be used to provide an <em>alternate value</em>
whenever the boolean evaluation of a reference is false.</p>
+<div class="codehilite"><pre><span class="x">My name is </span><span
class="p">${</span><span class="nv">name</span><span class="x">|&#39;John
Doe&#39;}</span>
+</pre></div>
+
+
+<p>If $name is null, empty, false or zero (see <a href="#conditionals">Conditionals</a>),
then the altername string <code>'John Doe'</code> will be displayed.</p>
 <h2 id="quiet-reference-notation">Quiet Reference Notation<a class="headerlink"
href="#quiet-reference-notation" title="Permanent link">&para;</a></h2>
 <p>When Velocity encounters an undefined reference, its normal behavior is to output
the image of the reference. For example, suppose the following reference appears as part of
a VTL template.</p>
 <div class="codehilite"><pre><span class="p">&lt;</span><span
class="nt">input</span> <span class="na">type</span><span class="o">=</span><span
class="s">&quot;text&quot;</span> <span class="na">name</span><span
class="o">=</span><span class="s">&quot;email&quot;</span> <span
class="na">value</span><span class="o">=</span><span class="s">&quot;</span><span
class="p">$</span><span class="nv">email</span><span class="s">&quot;</span><span
class="p">/&gt;</span>
@@ -618,7 +626,7 @@ h2:hover > .headerlink, h3:hover > .head
 <p>Note: <em>References to instance variables in a template are not resolved.</em>
Only references to the attribute equivalents of JavaBean getter/setter methods are resolved
(i.e. <code>$foo.Name</code> does resolve to the class Foo's <code>getName()</code>
instance method, but not to a public <code>Name</code> instance variable of Foo).</p>
 <h2 id="directives">Directives<a class="headerlink" href="#directives" title="Permanent
link">&para;</a></h2>
 <p>References allow template designers to generate dynamic content for web sites, while
<em>directives</em> -- easy to use script elements that can be used to creatively
manipulate the output of Java code -- permit web designers to truly take charge of the appearance
and content of the web site.</p>
-<p>Directives always begin with a <code>#</code>.  Like references, the
name of the directive may be bracketed by a <code>{</code> and a <code>}</code>
symbol.  This is useful with directives that are immediately followed by text.  For example
the following produces an error:</p>
+<p>Directives always begin with a <code>#</code>.  Like references, the
name of the directive may be bracketed by a <code>{</code> and a <code>}</code>
symbol.  This is useful with directives that are immediately followed by text.  For example
the following will display <code>true enough#elseno way!</code>, which probably
isn't the expected behavior.</p>
 <div class="codehilite"><pre><span class="cp">#</span><span class="nf">if</span><span
class="p">($</span><span class="nv">a</span><span class="o">==</span><span
class="m">1</span><span class="p">)</span><span class="x">true
enough</span><span class="cp">#</span><span class="nf">elseno</span><span
class="x"> way!</span><span class="cp">#</span><span class="nf">end</span><span
class="x"></span>
 </pre></div>
 

Modified: velocity/site/production/engine/devel/vtl-reference.html
URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/vtl-reference.html?rev=1843798&r1=1843797&r2=1843798&view=diff
==============================================================================
--- velocity/site/production/engine/devel/vtl-reference.html (original)
+++ velocity/site/production/engine/devel/vtl-reference.html Sat Oct 13 22:32:15 2018
@@ -226,41 +226,60 @@ h2:hover > .headerlink, h3:hover > .head
 <h2 id="about-this-guide">About this Guide<a class="headerlink" href="#about-this-guide"
title="Permanent link">&para;</a></h2>
 <p>This guide is the reference for the Velocity Template Language (VTL). For more information,
please also refer to the <a href="user-guide.html">Velocity User Guide</a>.</p>
 <h2 id="references">References<a class="headerlink" href="#references" title="Permanent
link">&para;</a></h2>
+<p>In the following syntax references, <em>identifier</em> refers to:</p>
+<p>( <strong>a..z</strong>, <strong>A..Z</strong>, <strong>_</strong>
) [ ( <strong>a..z</strong>, <strong>A..Z</strong>, <strong>0..9</strong>,
<strong>_</strong> ) , ( <strong>a..z</strong>, <strong>A..Z</strong>,
<strong>0..9</strong>, <strong>_</strong> ), ... ]</p>
+<p>that is, a letter or an underscore followed by any number of letters, numbers and
underscores.</p>
+<p>If the <code>parser.allows.dash.identifiers</code> configuration value
is set to true, then the <strong>-</strong> dash is also allowed in identifiers
(and must be surrounded by spaces to be interpreted as an arithmetic minus operator).</p>
 <h3 id="variables">Variables<a class="headerlink" href="#variables" title="Permanent
link">&para;</a></h3>
 <p>Notation:</p>
-<p><strong>$</strong> [ <strong>!</strong> ][ <strong>{</strong>
][<strong>a..z</strong>, <strong>A..Z</strong> ][ <strong>a..z</strong>,
<strong>A..Z</strong>, <strong>0..9</strong>, <strong>_</strong>
][ <strong>}</strong> ]</p>
+<p><strong>$</strong> [ <strong>!</strong> ] [ <strong>{</strong>
] <em>identifier</em> [ [ <strong>|</strong> <em>alternate value</em>
] <strong>}</strong> ]</p>
+<p>Usage:</p>
+<ul>
+<li><em>alternate value</em>: alternate expression to use if the reference
is null, empty, false or zero</li>
+</ul>
 <p>Examples:</p>
 <ul>
 <li>Shorthand notation: <code>$mudSlinger_9</code></li>
 <li>Silent Shorthand notation: <code>$!mudSlinger_9</code></li>
 <li>Formal notation: <code>${mudSlinger_9}</code></li>
 <li>Silent Formal notation: <code>$!{mudSlinger_9}</code></li>
+<li>Alternate value: <code>${mudSlinger_9|$otherWheels}</code></li>
 </ul>
 <p><em>Note that for backward compatibility reasons, it's possible to enable
'<strong><code>-</code></strong>' as a valid character in variables
identifiers, <a href="configuration.html#parser-configuration">see the parser configuration
section</a>.</em></p>
 <h3 id="properties">Properties<a class="headerlink" href="#properties" title="Permanent
link">&para;</a></h3>
 <p>Notation:</p>
-<p><strong>$</strong> [ <strong>{</strong> ][ <strong>a..z</strong>,
<strong>A..Z</strong> ][ <strong>a..z</strong>, <strong>A..Z</strong>,
<strong>0..9</strong>, <strong>_</strong> ]<em> <strong>.</strong>[<strong>a..z</strong>,
<strong>A..Z</strong> ][<strong>a..z</strong>, <strong>A-Z</strong>,
<strong>0..9</strong>, <strong>_</strong> ]</em> [ <strong>}</strong>
]</p>
+<p><strong>$</strong> [ <strong>{</strong> ] <em>identifier</em>
<strong>.</strong> <em>identifier</em> [ [ <strong>|</strong>
<em>alternate value</em> ] <strong>}</strong> ]</p>
+<p>Usage:</p>
+<ul>
+<li><em>alternate value</em>: alternate expression to use if the property
is null, empty, false or zero</li>
+</ul>
 <p>Examples:</p>
 <ul>
-<li>Regular Notation: <code>$customer.Address</code>
+<li>Regular Notation: <code>$customer.Address</code></li>
 <li>Formal Notation: <code>${purchase.Total}</code></li>
+<li>Alternate Value: <code>${person.name|'John Doe'}</code></li>
 </ul>
 <h3 id="methods">Methods<a class="headerlink" href="#methods" title="Permanent link">&para;</a></h3>
 <p>Notation:</p>
-<p><strong>$</strong> [ <strong>{</strong> ][ <strong>a..z</strong>,
<strong>A..Z</strong> ][ <strong>a..z</strong>, <strong>A..Z</strong>,
<strong>0..9</strong>, <strong>_</strong> ]<em> <strong>.</strong>[
<strong>a..z</strong>, <strong>A..Z</strong> ][<strong>a..z</strong>,
<strong>A..Z</strong>, <strong>0..9</strong>, <strong>_</strong>
]<strong><em>(</em><em> [</em>optional parameter list...* ]
</strong>)<strong> [</strong> } </em>*]</p>
+<p><strong>$</strong> [ <strong>{</strong> ] <em>identifier</em>
<strong>.</strong> <em>identifier</em> <strong>(</strong>
[ <em>parameter list...</em> ] <strong>)</strong> [ [ <strong>|</strong>
<em>alternate value</em> ] <strong>}</strong> ]</p>
+<p>Usage:</p>
+<ul>
+<li><em>alternate value</em>: alternate expression to use if the method
returns null, empty, false or zero</li>
+<li><em>parameter list</em>: optional coma-separated list of expressions</li>
+</ul>
 <p>Examples:</p>
 <ul>
 <li>Regular Notation: <code>$customer.getAddress()</code></li>
 <li>Formal Notation: <code>${purchase.getTotal()}</code></li>
 <li>Regular Notation with Parameter List: <code>$page.setTitle( "My Home Page"
)</code></li>
+<li>Alternate value: <code>${page.getTitle()|'Blank Page'}</code></li>
 </ul>
 <p>VTL Properties can be used as a shorthand notation for VTL Methods that take <em>get</em>
and <em>set</em>. Either <em>$object.getMethod()</em> or <em>$object.setMethod()</em>
can be abbreviated as <em>$object.Method</em>. It is generally preferable to use
a Property when available. The main difference between Properties and Methods is that you
can specify a parameter list to a Method.</p>
 <p>Each method argument can be any valid VTL expression.</p>
 <h2 id="directives">Directives<a class="headerlink" href="#directives" title="Permanent
link">&para;</a></h2>
 <h3 id="set-establishes-the-value-of-a-reference">#set - Establishes the value of a
reference<a class="headerlink" href="#set-establishes-the-value-of-a-reference" title="Permanent
link">&para;</a></h3>
 <p>Format:</p>
-<p><strong>#</strong> [ <strong>{</strong> ] <strong>set</strong>
[ <strong>}</strong> ] <strong> ( $</strong>ref <strong>=</strong>
[ <strong>"</strong>,
-    <strong>'</strong> ]arg[ <strong>"</strong>, <strong>'</strong>
] )</p>
+<p><strong>#</strong> [ <strong>{</strong> ] <strong>set</strong>
[ <strong>}</strong> ] <strong>(</strong> <em>$ref</em>
<strong>=</strong> [ <strong>"</strong>, <strong>'</strong>
] <em>arg</em> [ <strong>"</strong>, <strong>'</strong>
] )</p>
 <p>Usage:</p>
 <ul>
 <li><em>$ref</em> - The LHS of the assignment must be a variable reference
or a property reference.</li>
@@ -287,7 +306,7 @@ h2:hover > .headerlink, h3:hover > .head
 </ul>
 <h3 id="ifelseifelse-output-conditional-on-truth-of-statements">#if/#elseif/#else -
Output conditional on truth of statements<a class="headerlink" href="#ifelseifelse-output-conditional-on-truth-of-statements"
title="Permanent link">&para;</a></h3>
 <p>Format:</p>
-<p><strong>#</strong> [ <strong>{</strong> ] <strong>if</strong>
[ <strong>}</strong> ] <strong>(</strong> [condition] <strong>)</strong>
[output] [<strong>#</strong> [ <strong>{</strong> ] <strong>elseif</strong>
[ <strong>}</strong> ] <strong>( </strong>[condition] <strong>)</strong>
[output] ]* [<strong>#</strong> [ <strong>{</strong> ] <strong>else</strong>
[ <strong>}</strong> ]  [output] ] <strong>#</strong> [ <strong>{</strong>
] <strong>end</strong> [ <strong>}</strong> ]</p>
+<p><strong>#</strong> [ <strong>{</strong> ] <strong>if</strong>
[ <strong>}</strong> ] <strong>(</strong> <em>condition</em>
<strong>)</strong> <em>output</em> [<strong>#</strong>
[ <strong>{</strong> ] <strong>elseif</strong> [ <strong>}</strong>
] <strong>(</strong> <em>condition</em> <strong>)</strong>
<em>output</em> ] [ <strong>#</strong> [ <strong>{</strong>
] <strong>else</strong> [ <strong>}</strong> ]  <em>output</em>
] <strong>#</strong> [ <strong>{</strong> ] <strong>end</strong>
[ <strong>}</strong> ]</p>
 <p>Usage:</p>
 <ul>
 <li>
@@ -378,7 +397,7 @@ h2:hover > .headerlink, h3:hover > .head
 </table>
 <p>Notes:</p>
 <ol>
-<li>The == operator can be used to compare numbers, strings, objects of the same class,
or objects of different classes.  In the last case (when objects are of different classes),
the toString() method is called on each object and the resulting Strings are compared.</li>
+<li>The == operator can be used to compare numbers, strings, objects of the same class,
or objects of different classes.  In the last case (when objects are of different classes),
if at least one the two objects cannot be converted to a number, the toString() method is
called on each object and the resulting Strings are compared.</li>
 <li>You can also use brackets to delimit directives.  This is especially useful when
text immediately follows an <code>#else</code> directive.<div class="codehilite"><pre><span
class="cp">#</span><span class="nf">if</span><span class="p">($</span><span
class="nv">foo</span> <span class="o">==</span> <span class="p">$</span><span
class="nv">bar</span><span class="p">)</span><span class="x">it&#39;s
true!</span><span class="cp">#{</span><span class="nf">else</span><span
class="cp">}</span><span class="x">it&#39;s not!</span><span class="cp">#</span><span
class="nf">end</span><span class="x"></span>
 </pre></div>
 
@@ -387,7 +406,7 @@ h2:hover > .headerlink, h3:hover > .head
 </ol>
 <h3 id="foreach-loops-through-a-list-of-objects">#foreach - Loops through a list of
objects<a class="headerlink" href="#foreach-loops-through-a-list-of-objects" title="Permanent
link">&para;</a></h3>
 <p>Format:</p>
-<p><strong>#</strong> [ <strong>{</strong> ] <strong>foreach</strong>
[ <strong>}</strong> ] <strong>(<strong><em>$ref</em></strong>in<strong><em>arg</em></strong>)<strong><em>statement</em></strong>#</strong>
[ <strong>{</strong> ] <strong>end</strong> [ <strong>}</strong>
]</p>
+<p><strong>#</strong> [ <strong>{</strong> ] <strong>foreach</strong>
[ <strong>}</strong> ] <strong>(</strong> <em>$ref</em>
<strong>in</strong> <em>arg</em> <strong>)</strong> <em>statement</em>
<strong>#</strong> [ <strong>{</strong> ] <strong>end</strong>
[ <strong>}</strong> ]</p>
 <p>Usage:</p>
 <ul>
 <li><em>$ref</em> - The first variable reference is the item.</li>
@@ -417,7 +436,7 @@ h2:hover > .headerlink, h3:hover > .head
 
 <h3 id="include-renders-local-files-that-are-not-parsed-by-velocity">#include - Renders
local file(s) that are not parsed by Velocity<a class="headerlink" href="#include-renders-local-files-that-are-not-parsed-by-velocity"
title="Permanent link">&para;</a></h3>
 <p>Format:</p>
-<p><strong>#</strong> [ <strong>{</strong> ] <strong>include</strong>
[ <strong>}</strong> ] <strong>( </strong>arg[ arg2  ... argn]<strong>
)</strong></p>
+<p><strong>#</strong> [ <strong>{</strong> ] <strong>include</strong>
[ <strong>}</strong> ] <strong>(</strong> <em>arg</em>
[ <em>arg2</em>  ... <em>argn</em> ] <strong>)</strong></p>
 <p>Usage:</p>
 <ul>
 <li><em>arg</em> - Refers to a valid file under TEMPLATE_ROOT.</li>
@@ -429,7 +448,7 @@ h2:hover > .headerlink, h3:hover > .head
 </ul>
 <h3 id="parse-renders-a-local-template-that-is-parsed-by-velocity">#parse - Renders
a local template that is parsed by Velocity<a class="headerlink" href="#parse-renders-a-local-template-that-is-parsed-by-velocity"
title="Permanent link">&para;</a></h3>
 <p>Format:</p>
-<p><strong>#</strong> [ <strong>{</strong> ] <strong>parse</strong>
[ <strong>}</strong> ] <strong>(</strong> arg <strong>)</strong></p></p>
+<p><strong>#</strong> [ <strong>{</strong> ] <strong>parse</strong>
[ <strong>}</strong> ] <strong>(</strong> <em>arg</em>
<strong>)</strong></p></p>
 <p>Usage:</p>
 <ul>
 <li><em>arg</em> - Refers to a template under TEMPLATE_ROOT.</li>
@@ -452,7 +471,7 @@ h2:hover > .headerlink, h3:hover > .head
 <p>This will break execution of the current content directive. This is good for exiting
a #foreach loop early, but also works in other scopes. You can even pass the scope control
reference for a specific outer scope to break execution of all scopes outward to the specified
one.</p>
 <h3 id="evaluate-dynamically-evaluates-a-string-or-reference">#evaluate - Dynamically
evaluates a string or reference<a class="headerlink" href="#evaluate-dynamically-evaluates-a-string-or-reference"
title="Permanent link">&para;</a></h3>
 <p>Format:</p>
-<p><strong>#</strong> [ <strong>{</strong> ] <strong>evaluate</strong>
[ <strong>}</strong> ] <strong>( </strong>arg<strong> )</strong></p>
+<p><strong>#</strong> [ <strong>{</strong> ] <strong>evaluate</strong>
[ <strong>}</strong> ] <strong>(</strong> <em>arg</em>
<strong>)</strong></p>
 <p>Usage:</p>
 <ul>
 <li><em>arg</em> - String literal or reference to be dynamically evaluated.</li>
@@ -464,7 +483,7 @@ h2:hover > .headerlink, h3:hover > .head
 </ul>
 <h3 id="define-assigns-a-block-of-vtl-to-a-reference">#define - Assigns a block of
VTL to a reference<a class="headerlink" href="#define-assigns-a-block-of-vtl-to-a-reference"
title="Permanent link">&para;</a></h3>
 <p>Format:</p>
-<p><strong>#</strong> [ <strong>{</strong> ] <strong>define</strong>
[ <strong>}</strong> ] <strong>( <strong><em>$ref</em></strong>
)<strong><em>statement</em></strong>#</strong> [ <strong>{</strong>
] <strong>end</strong> [ <strong>}</strong> ]</p>
+<p><strong>#</strong> [ <strong>{</strong> ] <strong>define</strong>
[ <strong>}</strong> ] <strong>(<em> </em>$ref* </strong>)<strong>
<em>statement</em> </strong>#<strong> [ </strong>{<strong>
] </strong>end<strong> [ </strong>}** ]</p>
 <p>Usage:</p>
 <ul>
 <li><em>$ref</em> - Reference that is assigned the VTL block as a value.</li>
@@ -476,13 +495,13 @@ h2:hover > .headerlink, h3:hover > .head
 </ul>
 <h3 id="macro-allows-users-to-define-a-velocimacro-vm-a-repeated-segment-of-a-vtl-template-as-required">#macro
- Allows users to define a Velocimacro (VM), a repeated segment of a VTL template, as required<a
class="headerlink" href="#macro-allows-users-to-define-a-velocimacro-vm-a-repeated-segment-of-a-vtl-template-as-required"
title="Permanent link">&para;</a></h3>
 <p>Format:</p>
-<p><strong>#</strong> [ <strong>{</strong> ] <strong>macro</strong>
[ <strong>}</strong> ] <strong>(</strong> vmname $arg1 [ = def1 ]
[ $arg2 [ = def2 ] $arg3 [ = def3 ] ... $argn [ = defn ] ] <strong>)</strong>
[ VM VTL code... ] <strong>#</strong> [ <strong>{</strong> ] <strong>end</strong>
[ <strong>}</strong> ]</p>
+<p><strong>#</strong> [ <strong>{</strong> ] <strong>macro</strong>
[ <strong>}</strong> ] <strong>(</strong> <em>vmname</em>
<em>$arg1</em> [ <strong>=</strong> <em>def1</em> ] [
<em>$arg2</em> [ <strong>=</strong> <em>def2</em> ] <em>$arg3</em>
[ <strong>=</strong> def3 ] ... <em>$argn</em> [ <strong>=</strong>
<em>defn</em> ] ] <strong>)</strong> [ <em>VTL code</em>
] <strong>#</strong> [ <strong>{</strong> ] <strong>end</strong>
[ <strong>}</strong> ]</p>
 <p>Usage:</p>
 <ul>
 <li><em>vmname</em> - Name used to call the VM (<em>#vmname</em>)</li>
 <li><em>$arg1 $arg2 [ ... ]</em> - Arguments to the VM. There can be any
number of arguments, but the number used at invocation must match the number specified in
the definition, unless there is a default value provided for missing parameters.</li>
 <li><em>def1, def2, ...</em> - Optional default values provided for macro
arguments. If a default value is provided for an argument, a default value must also be provided
to all subsequent arguments.</li>
-<li><em>[ VM VTL code... ]</em> - Any valid VTL code, anything you can
put into a template, can be put into a VM.</li>
+<li><em>VTL code</em> - Any valid VTL code, anything you can put into a
template, can be put into a VM.</li>
 </ul>
 <p>Once defined, the VM is used like any other VTL directive in a template.</p>
 <div class="codehilite"><pre><span class="cp">#</span><span class="nf">vmname</span><span
class="p">(</span> <span class="p">$</span><span class="nv">arg1</span>
<span class="p">$</span><span class="nv">arg2</span> <span class="p">)</span><span
class="x"></span>
@@ -509,7 +528,7 @@ h2:hover > .headerlink, h3:hover > .head
 
 <h3 id="multi-line-comments">Multi Line Comments<a class="headerlink" href="#multi-line-comments"
title="Permanent link">&para;</a></h3>
 <p>Example:</p>
-<div class="codehilite"><pre><span class="cp">#</span><span class="c">**</span>
+<div class="codehilite"><pre><span class="cp">#</span><span class="c">*</span>
 <span class="c">  This is a multiline comment.</span>
 <span class="c">  This is the second line.</span>
 <span class="c">*</span><span class="cp">#</span><span class="x"></span>



Mime
View raw message