Creating a template file

A template file is simply plain text which may contain optional elements which hold special meaning for the templating engine. These special elements include directives, references and comments, and are described in the section of this help document titled Velocity Template Language.

After creating a new template file in a jEdit buffer, the file must be saved into the templates directory or one of its subdirectories. This can be done using File> Save As ..., but the easiest method is to use the Plugins>Templates> Save template menu item. The latter method has the advantage that the Templates menu and dockable tree view are both updated automatically. If a template is saved by another method, it is possible to force the templates list to update by using the Plugins>Templates> Refresh templates menu item, or by using the Refresh templates menu item in the popup menu accessed by clicking the right mouse button in the dockable templates tree view.

TIP: by saving a template file with the file extension ".vm", jEdit should automatically use the Velocity mode for editing the tempate file. In this way, elements to be processed by the templating engine will be highlighted by jEdit's syntax highlighting engine.

After refreshing the Templates menu, the filename of the template file should appear on both the Templates menu, and in the dockable tree view. Filenames are often not very descriptive, though, so the Templates plugin supports labelling of templates using a special commenting syntax (refer to Special Comment: Template Label in the Velocity Template Language section of this help document).