Server IP : 103.119.228.120 / Your IP : 3.145.167.58 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/share/man/man1/ |
Upload File : |
.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "TTREE 1" .TH TTREE 1 "2014-04-24" "perl v5.16.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Template::Tools::ttree \- Process entire directory trees of templates .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& ttree [options] [files] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \fIttree\fR script is used to process entire directory trees containing template files. The resulting output from processing each file is then written to a corresponding file in a destination directory. The script compares the modification 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. .PP It supports a number of options which can be used to configure behaviour, define locations and set Template Toolkit options. The script first reads the \fI.ttreerc\fR configuration file in the \s-1HOME\s0 directory, or an alternative file specified in the \s-1TTREERC\s0 environment variable. Then, it processes any command line arguments, including any additional configuration files specified via the \f(CW\*(C`\-f\*(C'\fR (file) option. .SS "The \fI.ttreerc\fP Configuration File" .IX Subsection "The .ttreerc Configuration File" When you run \fIttree\fR for the first time it will ask you if you want it to create a \fI.ttreerc\fR file for you. This will be created in your home directory. .PP .Vb 4 \& $ ttree \& Do you want me to create a sample \*(Aq.ttreerc\*(Aq file for you? \& (file: /home/abw/.ttreerc) [y/n]: y \& /home/abw/.ttreerc created. Please edit accordingly and re\-run ttree .Ve .PP The purpose of this file is to set any \fIglobal\fR configuration options that you want applied \fIevery\fR time \fIttree\fR is run. For example, you can use the \f(CW\*(C`ignore\*(C'\fR and \f(CW\*(C`copy\*(C'\fR / \f(CW\*(C`link\*(C'\fR options to provide regular expressions that specify which files should be ignored and which should be copied or linked rather than being processed as templates. You may also want to set flags like \f(CW\*(C`verbose\*(C'\fR and \f(CW\*(C`recurse\*(C'\fR according to your preference. .PP A minimal \fI.ttreerc\fR: .PP .Vb 4 \& # ignore these files \& ignore = \eb(CVS|RCS)\eb \& ignore = ^# \& ignore = ~$ \& \& # copy these files \& copy = \e.(gif|png|jpg|pdf)$ \& \& # recurse into directories \& recurse \& \& # provide info about what\*(Aqs going on \& verbose .Ve .PP In most cases, you'll want to create a different \fIttree\fR configuration file for each project you're working on. The \f(CW\*(C`cfg\*(C'\fR option allows you to specify a directory where \fIttree\fR can find further configuration files. .PP .Vb 1 \& cfg = /home/abw/.ttree .Ve .PP The \f(CW\*(C`\-f\*(C'\fR command line option can be used to specify which configuration file should be used. You can specify a filename using an absolute or relative path: .PP .Vb 3 \& $ ttree \-f /home/abw/web/example/etc/ttree.cfg \& $ ttree \-f ./etc/ttree.cfg \& $ ttree \-f ../etc/ttree.cfg .Ve .PP If the configuration file does not begin with \f(CW\*(C`/\*(C'\fR or \f(CW\*(C`.\*(C'\fR or something that looks like a MS-DOS absolute path (e.g. \f(CW\*(C`C:\e\eetc\e\ettree.cfg\*(C'\fR) then \&\fIttree\fR will look for it in the directory specified by the \f(CW\*(C`cfg\*(C'\fR option. .PP .Vb 1 \& $ ttree \-f test1 # /home/abw/.ttree/test1 .Ve .PP The \f(CW\*(C`cfg\*(C'\fR option can only be used in the \fI.ttreerc\fR file. All the other options can be used in the \fI.ttreerc\fR or any other \fIttree\fR configuration file. They can all also be specified as command line options. .PP Remember that \fI.ttreerc\fR is always processed \fIbefore\fR any configuration file specified with the \f(CW\*(C`\-f\*(C'\fR option. Certain options like \f(CW\*(C`lib\*(C'\fR can be used any number of times and accumulate their values. .PP For example, consider the following configuration files: .PP \&\fI/home/abw/.ttreerc\fR: .PP .Vb 2 \& cfg = /home/abw/.ttree \& lib = /usr/local/tt2/templates .Ve .PP \&\fI/home/abw/.ttree/myconfig\fR: .PP .Vb 1 \& lib = /home/abw/web/example/templates/lib .Ve .PP When \fIttree\fR is invoked as follows: .PP .Vb 1 \& $ ttree \-f myconfig .Ve .PP the \f(CW\*(C`lib\*(C'\fR option will be set to the following directories: .PP .Vb 2 \& /usr/local/tt2/templates \& /home/abw/web/example/templates/lib .Ve .PP Any templates located under \fI/usr/local/tt2/templates\fR will be used in preference to those located under \&\fI/home/abw/web/example/templates/lib\fR. This may be what you want, but then again, it might not. For this reason, it is good practice to keep the \fI.ttreerc\fR as simple as possible and use different configuration files for each \fIttree\fR project. .SS "Directory Options" .IX Subsection "Directory Options" The \f(CW\*(C`src\*(C'\fR option is used to define the directory containing the source templates to be processed. It can be provided as a command line option or in a configuration file as shown here: .PP .Vb 1 \& src = /home/abw/web/example/templates/src .Ve .PP Each template in this directory typically corresponds to a single web page or other document. .PP The \f(CW\*(C`dest\*(C'\fR option is used to specify the destination directory for the generated output. .PP .Vb 1 \& dest = /home/abw/web/example/html .Ve .PP The \f(CW\*(C`lib\*(C'\fR option is used to define one or more directories containing additional library templates. These templates are not documents in their own right and typically comprise of smaller, modular components like headers, footers and menus that are incorporated into pages templates. .PP .Vb 2 \& lib = /home/abw/web/example/templates/lib \& lib = /usr/local/tt2/templates .Ve .PP The \f(CW\*(C`lib\*(C'\fR option can be used repeatedly to add further directories to the search path. .PP A list of templates can be passed to \fIttree\fR as command line arguments. .PP .Vb 1 \& $ ttree foo.html bar.html .Ve .PP It looks for these templates in the \f(CW\*(C`src\*(C'\fR directory and processes them through the Template Toolkit, using any additional template components from the \f(CW\*(C`lib\*(C'\fR directories. The generated output is then written to the corresponding file in the \f(CW\*(C`dest\*(C'\fR directory. .PP If \fIttree\fR is invoked without explicitly specifying any templates to be processed then it will process every file in the \f(CW\*(C`src\*(C'\fR directory. If the \f(CW\*(C`\-r\*(C'\fR (recurse) option is set then it will additionally iterate down through sub-directories and process and other template files it finds therein. .PP .Vb 1 \& $ ttree \-r .Ve .PP If a template has been processed previously, \fIttree\fR will compare the modification times of the source and destination files. If the source template (or one it is dependant on) has not been modified more recently than the generated output file then \fIttree\fR will not process it. The \fI\-a\fR (all) option can be used to force \fIttree\fR to process all files regardless of modification time. .PP .Vb 1 \& $ tree \-a .Ve .PP Any templates explicitly named as command line argument are always processed and the modification time checking is bypassed. .SS "File Options" .IX Subsection "File Options" The \f(CW\*(C`ignore\*(C'\fR, \f(CW\*(C`copy\*(C'\fR, \f(CW\*(C`link\*(C'\fR and \f(CW\*(C`accept\*(C'\fR options are used to specify Perl regexen to filter file names. Files that match any of the \&\f(CW\*(C`ignore\*(C'\fR options will not be processed. Remaining files that match any of the \f(CW\*(C`copy\*(C'\fR or \f(CW\*(C`link\*(C'\fR regexen will be copied or linked to the destination directory. Remaining files that then match any of the \&\f(CW\*(C`accept\*(C'\fR criteria are then processed via the Template Toolkit. If no \&\f(CW\*(C`accept\*(C'\fR parameter is specified then all files will be accepted for processing if not already copied or ignored. .PP .Vb 4 \& # ignore these files \& ignore = \eb(CVS|RCS)\eb \& ignore = ^# \& ignore = ~$ \& \& # copy these files \& copy = \e.(gif|png|jpg|pdf)$ \& \& # accept only .tt2 templates \& accept = \e.tt2$ .Ve .PP The \f(CW\*(C`suffix\*(C'\fR option is used to define mappings between the file extensions for source templates and the generated output files. The following example specifies that source templates with a \f(CW\*(C`.tt2\*(C'\fR suffix should be output as \f(CW\*(C`.html\*(C'\fR files: .PP .Vb 1 \& suffix tt2=html .Ve .PP Or on the command line, .PP .Vb 1 \& \-\-suffix tt2=html .Ve .PP You can provide any number of different suffix mappings by repeating this option. .PP The \f(CW\*(C`binmode\*(C'\fR option is used to set the encoding of the output file. For example use \f(CW\*(C`\-\-binmode=:utf8\*(C'\fR to set the output format to unicode. .SS "Template Dependencies" .IX Subsection "Template Dependencies" The \f(CW\*(C`depend\*(C'\fR and \f(CW\*(C`depend_file\*(C'\fR options allow you to specify how any given template file depends on another file or group of files. The \f(CW\*(C`depend\*(C'\fR option is used to express a single dependency. .PP .Vb 1 \& $ ttree \-\-depend foo=bar,baz .Ve .PP This command line example shows the \f(CW\*(C`\-\-depend\*(C'\fR option being used to specify that the \fIfoo\fR file is dependant on the \fIbar\fR and \fIbaz\fR templates. This option can be used many time on the command line: .PP .Vb 1 \& $ ttree \-\-depend foo=bar,baz \-\-depend crash=bang,wallop .Ve .PP or in a configuration file: .PP .Vb 2 \& depend foo=bar,baz \& depend crash=bang,wallop .Ve .PP The file appearing on the left of the \f(CW\*(C`=\*(C'\fR is specified relative to the \f(CW\*(C`src\*(C'\fR or \f(CW\*(C`lib\*(C'\fR directories. The file(s) appearing on the right can be specified relative to any of these directories or as absolute file paths. .PP For example: .PP .Vb 1 \& $ ttree \-\-depend foo=bar,/tmp/baz .Ve .PP To define a dependency that applies to all files, use \f(CW\*(C`*\*(C'\fR on the left of the \f(CW\*(C`=\*(C'\fR. .PP .Vb 1 \& $ ttree \-\-depend *=header,footer .Ve .PP or in a configuration file: .PP .Vb 1 \& depend *=header,footer .Ve .PP Any templates that are defined in the \f(CW\*(C`pre_process\*(C'\fR, \f(CW\*(C`post_process\*(C'\fR, \&\f(CW\*(C`process\*(C'\fR or \f(CW\*(C`wrapper\*(C'\fR options will automatically be added to the list of global dependencies that apply to all templates. .PP The \f(CW\*(C`depend_file\*(C'\fR option can be used to specify a file that contains dependency information. .PP .Vb 1 \& $ ttree \-\-depend_file=/home/abw/web/example/etc/ttree.dep .Ve .PP Here is an example of a dependency file: .PP .Vb 1 \& # This is a comment. It is ignored. \& \& index.html: header footer menubar \& \& header: titlebar hotlinks \& \& menubar: menuitem \& \& # spanning multiple lines with the backslash \& another.html: header footer menubar \e \& sidebar searchform .Ve .PP Lines beginning with the \f(CW\*(C`#\*(C'\fR character are comments and are ignored. Blank lines are also ignored. All other lines should provide a filename followed by a colon and then a list of dependant files separated by whitespace, commas or both. Whitespace around the colon is also optional. Lines ending in the \f(CW\*(C`\e\*(C'\fR character are continued onto the following line. .PP Files that contain spaces can be quoted. That is only necessary for files after the colon (':'). The file before the colon may be quoted if it contains a colon. .PP As with the command line options, the \f(CW\*(C`*\*(C'\fR character can be used as a wildcard to specify a dependency for all templates. .PP .Vb 1 \& * : config,header .Ve .SS "Template Toolkit Options" .IX Subsection "Template Toolkit Options" \&\fIttree\fR also provides access to the usual range of Template Toolkit options. For example, the \f(CW\*(C`\-\-pre_chomp\*(C'\fR and \f(CW\*(C`\-\-post_chomp\*(C'\fR \fIttree\fR options correspond to the \f(CW\*(C`PRE_CHOMP\*(C'\fR and \f(CW\*(C`POST_CHOMP\*(C'\fR options. .PP Run \f(CW\*(C`ttree \-h\*(C'\fR for a summary of the options available. .SH "AUTHORS" .IX Header "AUTHORS" Andy Wardley <abw@andywardley.com> .PP <http://www.andywardley.com/> .PP With contributions from Dylan William Hardison (support for dependencies), Bryce Harrington (\f(CW\*(C`absolute\*(C'\fR and \f(CW\*(C`relative\*(C'\fR options), Mark Anderson (\f(CW\*(C`suffix\*(C'\fR and \f(CW\*(C`debug\*(C'\fR options), Harald Joerg and Leon Brocard who gets everywhere, it seems. .SH "VERSION" .IX Header "VERSION" 2.68, distributed as part of the Template Toolkit version 2.19, released on 27 April 2007. .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 1 \& Copyright (C) 1996\-2007 Andy Wardley. All Rights Reserved. .Ve .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" tpage