#!/usr/bin/perl use lib 'lib'; use Jemplate 0.19; Jemplate->main(@ARGV); =head1 Usage: jemplate --runtime jemplate (--compile|--list) [options] template-list =head2 Example: Write the Jemplate runtime code into Jemplate.js, then compile all the template files in the templates/ directory and put the output in my-jemplate.js. jemplate --runtime > Jemplate.js jemplate --compile templates/* > my-jemplate.js Do the same thing, but put the output into one file. jemplate --runtime > my-jemplate.js jemplate --compile templates/* >> my-jemplate.js =head2 template-list: The template-list is the list of template files that will be compiled. If something in the list is a file, then the template name will be just the file name. If it is a directory, then all the files under that directory will be found, and the relative paths to those files will be the template name. So 'template/foo/bar.tt2' will be named 'bar.tt2', but 'template/' will find a template named 'foo/bar.tt2'. It is important to know what Jemplate thinks the template name will be when you are writing templates or code that refers to other templates. Use the --list option to check this. =head1 Commands: -r, --runtime This flag tells Jemplate to print the Jemplate JavaScript runtime code to STDOUT. You should redirect this output into a .js file. -c, --compile The --compile flag tells Jemplate to actually compile templates. The output is written to STDOUT. -l, --list Just print (STDOUT) the template names that Jemplate would use from the template-list. B: The runtime code is also distributed as F, but this is deprecated and will be discontinued at some point. Please use the C command line tool with the C<--runtime> command, to create this file. =head1 Template Toolkit Compile Options: Jemplate allows you to specify the following Template Toolkit compile time options. Full descriptions of these options are available at L. These options may either be set as JEMPLATE_* environment variables or as command line switches. --start-tag (JEMPLATE_START_TAG) Specify the starting template delimiter to use. Default is '[%'. --end-tag (JEMPLATE_END_TAG) Specify the ending template delimiter to use. Default is '%]'. --pre-chomp (JEMPLATE_PRE_CHOMP) Chomp leading whitespace automatically. Default is off. --post-chomp (JEMPLATE_POST_CHOMP) Chomp trailing whitespace automatically. Default is off. --trim (JEMPLATE_TRIM) Trim leading and trailing whitespace. Default is off. --any-case (JEMPLATE_ANYCASE) Allow lower or mixed case for template directives. Default is off. --eval (--noeval) (JEMPLATE_EVAL_JAVASCRIPT) Allow the execution of raw JavaScript. Default is on. Use --noexec to disallow it. =head1 Jemplate Options: These compile time options are specific to Jemplate. -s, --source Include the original template source code as a JavaScript comment next to each compiled template. =cut