geirm 01/10/09 19:22:38
Modified: xdocs user-guide.xml
docs user-guide.html
Log:
added another VM tip
Revision Changes Path
1.50 +21 -3 jakarta-velocity/xdocs/user-guide.xml
Index: user-guide.xml
===================================================================
RCS file: /home/cvs/jakarta-velocity/xdocs/user-guide.xml,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- user-guide.xml 2001/10/06 11:14:22 1.49
+++ user-guide.xml 2001/10/10 02:22:38 1.50
@@ -859,9 +859,7 @@
<p>
Unlike some of the other Velocity directives, the <em>#set</em>
- directive does not have an <em>#end</em> statement. Instead, the
- left bracket marks the beginning and the right bracket marks the end
- of an assignment.
+ directive does not have an <em>#end</em> statement.
</p>
<a name="String Literals"><strong>String Literals</strong></a>
@@ -1951,6 +1949,26 @@
#set($color = $bar.rowColor())
#foo( $color )
]]></source>
+
+
+<strong>Can I register Velocimacros via #parse() ? </strong>
+
+ <p>
+ Currently, Velocimacros must be defined before they are first
+ used in a template. This means that your #macro() declarations
+ should come before using the Velocimacros.
+ </p>
+
+ <p>
+ This is important to remember if you try to #parse()
+ a template containing inline #macro() directives. Because
+ the #parse() happens at runtime, and the parser decides if
+ a VM-looking element in the template is a VM at parsetime,
+ #parse()-ing a set of VM declarations won't work as expected.
+ To get around this, simply use the <code>velocimacro.library</code>
+ facility to have Velocity load your VMs at startup.
+ </p>
+
</subsection>
1.53 +16 -3 jakarta-velocity/docs/user-guide.html
Index: user-guide.html
===================================================================
RCS file: /home/cvs/jakarta-velocity/docs/user-guide.html,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- user-guide.html 2001/10/06 11:14:22 1.52
+++ user-guide.html 2001/10/10 02:22:38 1.53
@@ -1486,9 +1486,7 @@
</div>
<p>
Unlike some of the other Velocity directives, the <em>#set</em>
- directive does not have an <em>#end</em> statement. Instead, the
- left bracket marks the beginning and the right bracket marks the end
- of an assignment.
+ directive does not have an <em>#end</em> statement.
</p>
<a name="String
Literals"><strong>String Literals</strong></a>
<p>
@@ -3543,6 +3541,21 @@
</tr>
</table>
</div>
+ <strong>Can I register Velocimacros
via #parse() ? </strong>
+ <p>
+ Currently, Velocimacros must be defined before they are first
+ used in a template. This means that your #macro() declarations
+ should come before using the Velocimacros.
+ </p>
+ <p>
+ This is important to remember if you try to #parse()
+ a template containing inline #macro() directives. Because
+ the #parse() happens at runtime, and the parser decides if
+ a VM-looking element in the template is a VM at parsetime,
+ #parse()-ing a set of VM declarations won't work as expected.
+ To get around this, simply use the <code>velocimacro.library</code>
+ facility to have Velocity load your VMs at startup.
+ </p>
</blockquote>
</td></tr>
<tr><td><br/></td></tr>