other versions
- wheezy 11.6-2
| TEMPLATES2ADA(1) | Templates Parser User's Guide | TEMPLATES2ADA(1) |
NAME¶
templates2ada - generate Ada sources from a templates fileSYNOPSIS¶
templates2ada [options]DESCRIPTION¶
templates2ada parses all the template files in a directory and then generates an output file from these, based on a template file (a default example of which is provided as /usr/share/doc/libtemplates-parser-dev/examples/templates.tads). The latter contains in fact two examples, depending on whether one Ada package should be generated per template, or whether a single package should be built. In the former case, if you are using the GNAT compiler, you should run `gnatchop' on the resulting file. Here is an example:$ rm -f src/templates/*.ads
$ templates2ada -d resources/ -o src/templates/generated -r
$ cd src/templates; gnatchop -w -q generated
$ rm -f src/templates/generated
<form>
<input name="PARAM1" value="@_TAG1_@" />
<input name="PARAM2" value="@_TAG2_@" />
</form>
package Templates.Block1 is
pragma Style_Checks (Off);
Template : constant string := "resources/block1.thtml";
Tag1 : constant String := "TAG1";
Tag2 : constant String := "TAG2";
package Http is
Param1 : constant String := "PARAM1";
Param2 : constant String := "PARAM2";
end Http;
end Templates.Block1;
OPTIONS¶
- -d dir
- Search for template files in dir.
- -h
- Display a summary of options.
- -o file
- Write the output to file.
- -e ext
- Process all files with extension ext that are in the
input directory; consider these files as template files.
- -r
- Recurse into subdirectories.
- -t file
- Use file as the output template file. The templates
parser comes with an example for such a file,
/usr/share/doc/templates-parser/examples/templates.tads, that you
can adapt to your own needs.
- -v
- Verbose mode. This will output a warning when an http
parameter has a name made only of template parser tags, since no matching
entry can then be created for it in the output file.
SEE ALSO¶
templatespp(1)AUTHOR¶
templates2ada was written by Pascal Obry <p.obry@wanadoo.fr> as part of the Ada Web Server.| 2008-05-04 | GNU Ada Tools |