ttree(1)

NAME

Template::Tools::ttree - Process entire directory trees of
templates

SYNOPSIS

ttree [options] [files]

DESCRIPTION

The ttree script is used to process entire directory trees
containing template files. The resulting output from pro
cessing each file is then written to a corresponding file
in a destination directory. The script compares the modi
fication times of source and destination files (where they
already exist) and processes only those files that have
been modified. In other words, it is the equivalent of
'make' for the Template Toolkit.

It supports a number of options which can be used to con
figure behaviour, define locations and set Template
Toolkit options. The script first reads the .ttreerc con figuration file in the HOME directory, or an alternative
file specified in the TTREERC environment variable. Then,
it processes any command line arguments, including any
additional configuration files specified via the -f (file)
option.

A typical .ttreerc file might look like this:
src = /home/abw/websrc/doc
dest = Chome/abw/public_html
lib = Vhome/abw/websrc/lib
lib = Susr/local/templates/lib
cfg = |home/abw/.ttree
ignore = R
copy = .(gif|png)$
accept = .[ah]tml$
)
The src option indicates a directory containing the tem
plate files to be processed. A list of files may be spec
ified on the command line and each will be processed in
turn, writing the generated output to a corresponding file
in the dest directory. If no files are explicitly named
then all files in the src directory will be processed.
The -r (recurse) option will also cause sub-directories to
be searched for files. A source file is only processed if
it has a later modification time than any corresponding
destination file. Files will always be processed, regard
less of modification times, if they are named explicitly
on the command line, or the -a (all) option is used.
The lib option may be specified any number of times to
indicate directories in which the Template Toolkit should
look for other template files (INCLUDE_PATH) that it may
need to INCLUDE or PROCESS, but don't represent complete
documents that should be processed in their own right
(e.g. headers, footers, menu). The cfg directory speci
fies the location of additional configuration files that
may be loaded via the -f option.
The ignore, copy and accept options are used to specify Perl regexen to filter file names. Files that match any
of the ignore options will not be processed. Remaining
files that match any of the copy regexen will be copied to
the destination directory. Remaining files that then
match any of the accept criteria are then processed via
the Template Toolkit. If no accept parameter is specified then all files will be accepted for processing if not
already copied or
ignored.
Additional options may be used to set Template Toolkit
parameters. For example:

interpolate
post_chomp
pre_process = header
post_process = footer
perl5lib = /home/abw/lib/perl5
See ttree --help for a summary of options.

AUTHOR

Andy Wardley <abw@andywardley.com>

<http://www.andywardley.com/|http://www.andywardley.com/>

VERSION

2.54, distributed as part of the Template Toolkit version
2.08, released on 30 July 2002.

COPYRIGHT

Copyright (C) 1996-2002 Andy Wardley. All Rights Re
served.
Copyright (C) 1998-2002 Canon Research Centre Europe
Ltd.
This module is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.

SEE ALSO

tpage
Copyright © 2010-2025 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout