Velocity
  1. Velocity
  2. VELOCITY-604

Document: Allow definition of macro's within parsed files

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4, 1.5
    • Fix Version/s: 1.6
    • Component/s: Documentation
    • Labels:
      None

      Description

      Your documentation at http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html#velocimacro_miscellany has the following snippet -

      "
      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.

      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.

        Activity

        Paul Curren created issue -
        Paul Curren made changes -
        Field Original Value New Value
        Description 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.
        Your documentation at http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html#velocimacro_miscellany has the following snippet -

        "
        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.

        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.
        Will Glass-Husain made changes -
        Component/s Engine [ 12311337 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Fix Version/s 1.6 [ 12310290 ]
        Component/s Documentation [ 12310213 ]
        Summary Allow definition of macro's within parsed files Document: Allow definition of macro's within parsed files
        Nathan Bubna made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Mark Thomas made changes -
        Workflow jira [ 12435236 ] Default workflow, editable Closed status [ 12551533 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12551533 ] jira [ 12552419 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Paul Curren
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development