Allow definition of macro's within parsed files
-----------------------------------------------

                 Key: VELOCITY-604
                 URL: https://issues.apache.org/jira/browse/VELOCITY-604
             Project: Velocity
          Issue Type: Improvement
          Components: Engine
    Affects Versions: 1.5, 1.4
            Reporter: Paul Curren


Your documentation at 
http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html#velocimacro_miscellany
 has the following snippet -
{panel}
h1. Velocimacro Trivia
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.

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 velocimacro.library facility to have Velocity load your 
VMs at startup.
{panel}

Is this likely to change in any forthcoming versions?

The use case is theme development for Confluence.  It would be nice to be able 
to share some common macro definitions between a number of templates within a 
theme (i.e. not inlining). And using the _velocimacro.library_ property isn't 
really an option because themes are dynamically loaded or unloaded.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to