FreeMarker sheets are detected by PCGen by their file name suffix. A template ending in .ftl will be processed by FreeMarker rather than by PCGen's legacy output engine.
The extension of the file to be produced should be immediately before that and preceded by a . or -. So a template to produce html output might be named csheet-first.html.ftl or chseet-compact-html.ftl and PCGen would pick up that it was a template to be processed by FreeMarker template that would produce output of a html file.
Inside the sheet, the file is just a text file, with functions or directives included when needed to produce dynamic output. It is often simplest to start with a static file that looks like the output you want and then gradually introduce FreeMarker tags to make the sheet show the character info.
FreeMarker has quite thorough documentation. The main references output sheet authors will use are:
In addition, see testsuite/base-xml.ftl for a fully worked example of xml output.
A Groovy script is available to convert a legacy PCGen sheet to FreeMarker. Get the script from GitHub . You will also need to download Groovy .
The script is run using the command
groovy convfreemarker.groovy sheetname [outputtemplatename]where sheetname is the path to the sheet you wish to convert and outputtemplatename is the nameof the FreeMarker template file to be created. If an outputtemplatename is not supplied, the output template will be the same name as the sheetname but with .ftl appended to it. e.g. groovy convfreemarker.groovy base.xml would produce base.xml.ftl
The following are the main steps that need to be made for manual conversion:
Manual tidy up will then be required including extracting repeated content to macros.