Add built local::lib
[catagits/Gitalist.git] / local-lib5 / man / man1 / ttree.1p
CommitLineData
3fea05b9 1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "TTREE 1"
132.TH TTREE 1 "2009-07-04" "perl v5.8.7" "User Contributed Perl Documentation"
133.SH "NAME"
134Template::Tools::ttree \- Process entire directory trees of templates
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137.Vb 1
138\& ttree [options] [files]
139.Ve
140.SH "DESCRIPTION"
141.IX Header "DESCRIPTION"
142The \fIttree\fR script is used to process entire directory trees containing
143template files. The resulting output from processing each file is then
144written to a corresponding file in a destination directory. The script
145compares the modification times of source and destination files (where
146they already exist) and processes only those files that have been modified.
147In other words, it is the equivalent of 'make' for the Template Toolkit.
148.PP
149It supports a number of options which can be used to configure
150behaviour, define locations and set Template Toolkit options. The
151script first reads the \fI.ttreerc\fR configuration file in the \s-1HOME\s0
152directory, or an alternative file specified in the \s-1TTREERC\s0 environment
153variable. Then, it processes any command line arguments, including
154any additional configuration files specified via the \f(CW\*(C`\-f\*(C'\fR (file)
155option.
156.Sh "The \fI.ttreerc\fP Configuration File"
157.IX Subsection "The .ttreerc Configuration File"
158When you run \fIttree\fR for the first time it will ask you if you want
159it to create a \fI.ttreerc\fR file for you. This will be created in your
160home directory.
161.PP
162.Vb 4
163\& $ ttree
164\& Do you want me to create a sample '.ttreerc' file for you?
165\& (file: /home/abw/.ttreerc) [y/n]: y
166\& /home/abw/.ttreerc created. Please edit accordingly and re\-run ttree
167.Ve
168.PP
169The purpose of this file is to set any \fIglobal\fR configuration options
170that you want applied \fIevery\fR time \fIttree\fR is run. For example, you
171can use the \f(CW\*(C`ignore\*(C'\fR and \f(CW\*(C`copy\*(C'\fR option to provide regular expressions
172that specify which files should be ignored and which should be copied
173rather than being processed as templates. You may also want to set
174flags like \f(CW\*(C`verbose\*(C'\fR and \f(CW\*(C`recurse\*(C'\fR according to your preference.
175.PP
176A minimal \fI.ttreerc\fR:
177.PP
178.Vb 4
179\& # ignore these files
180\& ignore = \eb(CVS|RCS)\eb
181\& ignore = ^#
182\& ignore = ~$
183.Ve
184.PP
185.Vb 2
186\& # copy these files
187\& copy = \e.(gif|png|jpg|pdf)$
188.Ve
189.PP
190.Vb 2
191\& # recurse into directories
192\& recurse
193.Ve
194.PP
195.Vb 2
196\& # provide info about what's going on
197\& verbose
198.Ve
199.PP
200In most cases, you'll want to create a different \fIttree\fR configuration
201file for each project you're working on. The \f(CW\*(C`cfg\*(C'\fR option allows you
202to specify a directory where \fIttree\fR can find further configuration
203files.
204.PP
205.Vb 1
206\& cfg = /home/abw/.ttree
207.Ve
208.PP
209The \f(CW\*(C`\-f\*(C'\fR command line option can be used to specify which configuration
210file should be used. You can specify a filename using an absolute or
211relative path:
212.PP
213.Vb 3
214\& $ ttree \-f /home/abw/web/example/etc/ttree.cfg
215\& $ ttree \-f ./etc/ttree.cfg
216\& $ ttree \-f ../etc/ttree.cfg
217.Ve
218.PP
219If the configuration file does not begin with \f(CW\*(C`/\*(C'\fR or \f(CW\*(C`.\*(C'\fR or something
220that looks like a MS-DOS absolute path (e.g. \f(CW\*(C`C:\e\eetc\e\ettree.cfg\*(C'\fR) then
221\&\fIttree\fR will look for it in the directory specified by the \f(CW\*(C`cfg\*(C'\fR option.
222.PP
223.Vb 1
224\& $ ttree \-f test1 # /home/abw/.ttree/test1
225.Ve
226.PP
227The \f(CW\*(C`cfg\*(C'\fR option can only be used in the \fI.ttreerc\fR file. All the
228other options can be used in the \fI.ttreerc\fR or any other \fIttree\fR
229configuration file. They can all also be specified as command line
230options.
231.PP
232Remember that \fI.ttreerc\fR is always processed \fIbefore\fR any
233configuration file specified with the \f(CW\*(C`\-f\*(C'\fR option. Certain options
234like \f(CW\*(C`lib\*(C'\fR can be used any number of times and accumulate their values.
235.PP
236For example, consider the following configuration files:
237.PP
238\&\fI/home/abw/.ttreerc\fR:
239.PP
240.Vb 2
241\& cfg = /home/abw/.ttree
242\& lib = /usr/local/tt2/templates
243.Ve
244.PP
245\&\fI/home/abw/.ttree/myconfig\fR:
246.PP
247.Vb 1
248\& lib = /home/abw/web/example/templates/lib
249.Ve
250.PP
251When \fIttree\fR is invoked as follows:
252.PP
253.Vb 1
254\& $ ttree \-f myconfig
255.Ve
256.PP
257the \f(CW\*(C`lib\*(C'\fR option will be set to the following directories:
258.PP
259.Vb 2
260\& /usr/local/tt2/templates
261\& /home/abw/web/example/templates/lib
262.Ve
263.PP
264Any templates located under \fI/usr/local/tt2/templates\fR will be used
265in preference to those located under
266\&\fI/home/abw/web/example/templates/lib\fR. This may be what you want,
267but then again, it might not. For this reason, it is good practice to
268keep the \fI.ttreerc\fR as simple as possible and use different
269configuration files for each \fIttree\fR project.
270.Sh "Directory Options"
271.IX Subsection "Directory Options"
272The \f(CW\*(C`src\*(C'\fR option is used to define the directory containing the
273source templates to be processed. It can be provided as a command
274line option or in a configuration file as shown here:
275.PP
276.Vb 1
277\& src = /home/abw/web/example/templates/src
278.Ve
279.PP
280Each template in this directory typically corresponds to a single
281web page or other document.
282.PP
283The \f(CW\*(C`dest\*(C'\fR option is used to specify the destination directory for the
284generated output.
285.PP
286.Vb 1
287\& dest = /home/abw/web/example/html
288.Ve
289.PP
290The \f(CW\*(C`lib\*(C'\fR option is used to define one or more directories containing
291additional library templates. These templates are not documents in
292their own right and typically comprise of smaller, modular components
293like headers, footers and menus that are incorporated into pages templates.
294.PP
295.Vb 2
296\& lib = /home/abw/web/example/templates/lib
297\& lib = /usr/local/tt2/templates
298.Ve
299.PP
300The \f(CW\*(C`lib\*(C'\fR option can be used repeatedly to add further directories to
301the search path.
302.PP
303A list of templates can be passed to \fIttree\fR as command line arguments.
304.PP
305.Vb 1
306\& $ ttree foo.html bar.html
307.Ve
308.PP
309It looks for these templates in the \f(CW\*(C`src\*(C'\fR directory and processes them
310through the Template Toolkit, using any additional template components
311from the \f(CW\*(C`lib\*(C'\fR directories. The generated output is then written to
312the corresponding file in the \f(CW\*(C`dest\*(C'\fR directory.
313.PP
314If \fIttree\fR is invoked without explicitly specifying any templates
315to be processed then it will process every file in the \f(CW\*(C`src\*(C'\fR directory.
316If the \f(CW\*(C`\-r\*(C'\fR (recurse) option is set then it will additionally iterate
317down through sub-directories and process and other template files it finds
318therein.
319.PP
320.Vb 1
321\& $ ttree \-r
322.Ve
323.PP
324If a template has been processed previously, \fIttree\fR will compare the
325modification times of the source and destination files. If the source
326template (or one it is dependant on) has not been modified more
327recently than the generated output file then \fIttree\fR will not process
328it. The \fI\-a\fR (all) option can be used to force \fIttree\fR to process
329all files regardless of modification time.
330.PP
331.Vb 1
332\& $ tree \-a
333.Ve
334.PP
335Any templates explicitly named as command line argument are always
336processed and the modification time checking is bypassed.
337.Sh "File Options"
338.IX Subsection "File Options"
339The \f(CW\*(C`ignore\*(C'\fR, \f(CW\*(C`copy\*(C'\fR and \f(CW\*(C`accept\*(C'\fR options are used to specify Perl
340regexen to filter file names. Files that match any of the \f(CW\*(C`ignore\*(C'\fR
341options will not be processed. Remaining files that match any of the
342\&\f(CW\*(C`copy\*(C'\fR regexen will be copied to the destination directory. Remaining
343files that then match any of the \f(CW\*(C`accept\*(C'\fR criteria are then processed
344via the Template Toolkit. If no \f(CW\*(C`accept\*(C'\fR parameter is specified then
345all files will be accepted for processing if not already copied or
346ignored.
347.PP
348.Vb 4
349\& # ignore these files
350\& ignore = \eb(CVS|RCS)\eb
351\& ignore = ^#
352\& ignore = ~$
353.Ve
354.PP
355.Vb 2
356\& # copy these files
357\& copy = \e.(gif|png|jpg|pdf)$
358.Ve
359.PP
360.Vb 2
361\& # accept only .tt2 templates
362\& accept = \e.tt2$
363.Ve
364.PP
365The \f(CW\*(C`suffix\*(C'\fR option is used to define mappings between the file
366extensions for source templates and the generated output files. The
367following example specifies that source templates with a \f(CW\*(C`.tt2\*(C'\fR
368suffix should be output as \f(CW\*(C`.html\*(C'\fR files:
369.PP
370.Vb 1
371\& suffix tt2=html
372.Ve
373.PP
374Or on the command line,
375.PP
376.Vb 1
377\& \-\-suffix tt2=html
378.Ve
379.PP
380You can provide any number of different suffix mappings by repeating
381this option.
382.PP
383The \f(CW\*(C`binmode\*(C'\fR option is used to set the encoding of the output file.
384For example use \f(CW\*(C`\-\-binmode=:utf8\*(C'\fR to set the output format to unicode.
385.Sh "Template Dependencies"
386.IX Subsection "Template Dependencies"
387The \f(CW\*(C`depend\*(C'\fR and \f(CW\*(C`depend_file\*(C'\fR options allow you to specify
388how any given template file depends on another file or group of files.
389The \f(CW\*(C`depend\*(C'\fR option is used to express a single dependency.
390.PP
391.Vb 1
392\& $ ttree \-\-depend foo=bar,baz
393.Ve
394.PP
395This command line example shows the \f(CW\*(C`\-\-depend\*(C'\fR option being used to
396specify that the \fIfoo\fR file is dependant on the \fIbar\fR and \fIbaz\fR
397templates. This option can be used many time on the command line:
398.PP
399.Vb 1
400\& $ ttree \-\-depend foo=bar,baz \-\-depend crash=bang,wallop
401.Ve
402.PP
403or in a configuration file:
404.PP
405.Vb 2
406\& depend foo=bar,baz
407\& depend crash=bang,wallop
408.Ve
409.PP
410The file appearing on the left of the \f(CW\*(C`=\*(C'\fR is specified relative to
411the \f(CW\*(C`src\*(C'\fR or \f(CW\*(C`lib\*(C'\fR directories. The file(s) appearing on the right
412can be specified relative to any of these directories or as absolute
413file paths.
414.PP
415For example:
416.PP
417.Vb 1
418\& $ ttree \-\-depend foo=bar,/tmp/baz
419.Ve
420.PP
421To define a dependency that applies to all files, use \f(CW\*(C`*\*(C'\fR on the
422left of the \f(CW\*(C`=\*(C'\fR.
423.PP
424.Vb 1
425\& $ ttree \-\-depend *=header,footer
426.Ve
427.PP
428or in a configuration file:
429.PP
430.Vb 1
431\& depend *=header,footer
432.Ve
433.PP
434Any templates that are defined in the \f(CW\*(C`pre_process\*(C'\fR, \f(CW\*(C`post_process\*(C'\fR,
435\&\f(CW\*(C`process\*(C'\fR or \f(CW\*(C`wrapper\*(C'\fR options will automatically be added to the
436list of global dependencies that apply to all templates.
437.PP
438The \f(CW\*(C`depend_file\*(C'\fR option can be used to specify a file that contains
439dependency information.
440.PP
441.Vb 1
442\& $ ttree \-\-depend_file=/home/abw/web/example/etc/ttree.dep
443.Ve
444.PP
445Here is an example of a dependency file:
446.PP
447.Vb 1
448\& # This is a comment. It is ignored.
449.Ve
450.PP
451.Vb 1
452\& index.html: header footer menubar
453.Ve
454.PP
455.Vb 1
456\& header: titlebar hotlinks
457.Ve
458.PP
459.Vb 1
460\& menubar: menuitem
461.Ve
462.PP
463.Vb 3
464\& # spanning multiple lines with the backslash
465\& another.html: header footer menubar \e
466\& sidebar searchform
467.Ve
468.PP
469Lines beginning with the \f(CW\*(C`#\*(C'\fR character are comments and are ignored.
470Blank lines are also ignored. All other lines should provide a
471filename followed by a colon and then a list of dependant files
472separated by whitespace, commas or both. Whitespace around the colon
473is also optional. Lines ending in the \f(CW\*(C`\e\*(C'\fR character are continued
474onto the following line.
475.PP
476Files that contain spaces can be quoted. That is only necessary
477for files after the colon (':'). The file before the colon may be
478quoted if it contains a colon.
479.PP
480As with the command line options, the \f(CW\*(C`*\*(C'\fR character can be used
481as a wildcard to specify a dependency for all templates.
482.PP
483.Vb 1
484\& * : config,header
485.Ve
486.Sh "Template Toolkit Options"
487.IX Subsection "Template Toolkit Options"
488\&\fIttree\fR also provides access to the usual range of Template Toolkit
489options. For example, the \f(CW\*(C`\-\-pre_chomp\*(C'\fR and \f(CW\*(C`\-\-post_chomp\*(C'\fR \fIttree\fR
490options correspond to the \f(CW\*(C`PRE_CHOMP\*(C'\fR and \f(CW\*(C`POST_CHOMP\*(C'\fR options.
491.PP
492Run \f(CW\*(C`ttree \-h\*(C'\fR for a summary of the options available.
493.SH "AUTHORS"
494.IX Header "AUTHORS"
495Andy Wardley <abw@andywardley.com>
496.PP
497<http://www.andywardley.com/|http://www.andywardley.com/>
498.PP
499With contributions from Dylan William Hardison (support for
500dependencies), Bryce Harrington (\f(CW\*(C`absolute\*(C'\fR and \f(CW\*(C`relative\*(C'\fR options),
501Mark Anderson (\f(CW\*(C`suffix\*(C'\fR and \f(CW\*(C`debug\*(C'\fR options), Harald Joerg and Leon
502Brocard who gets everywhere, it seems.
503.SH "VERSION"
504.IX Header "VERSION"
5052.68, distributed as part of the
506Template Toolkit version 2.19, released on 27 April 2007.
507.SH "COPYRIGHT"
508.IX Header "COPYRIGHT"
509.Vb 1
510\& Copyright (C) 1996\-2007 Andy Wardley. All Rights Reserved.
511.Ve
512.PP
513This module is free software; you can redistribute it and/or
514modify it under the same terms as Perl itself.
515.SH "SEE ALSO"
516.IX Header "SEE ALSO"
517tpage