{
    "content": [
        {
            "type": "text",
            "text": "# ttree (man)\n\n## NAME\n\nTemplate::Tools::ttree - Process entire directory trees of templates\n\n## SYNOPSIS\n\nttree [options] [files]\n\n## DESCRIPTION\n\nThe ttree script is used to process entire directory trees containing template files.  The\nresulting output from processing each file is then written to a corresponding file in a\ndestination directory.  The script compares the modification times of source and destination\nfiles (where they already exist) and processes only those files that have been modified.  In\nother words, it is the equivalent of 'make' for the Template Toolkit.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (4 subsections)\n- **AUTHORS**\n- **VERSION**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "ttree",
        "section": "",
        "mode": "man",
        "summary": "Template::Tools::ttree - Process entire directory trees of templates",
        "synopsis": "ttree [options] [files]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 95,
                "subsections": [
                    {
                        "name": "Directory Options",
                        "lines": 48
                    },
                    {
                        "name": "File Options",
                        "lines": 33
                    },
                    {
                        "name": "Template Dependencies",
                        "lines": 68
                    },
                    {
                        "name": "Template Toolkit Options",
                        "lines": 6
                    }
                ]
            },
            {
                "name": "AUTHORS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Template::Tools::ttree - Process entire directory trees of templates\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "ttree [options] [files]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The ttree script is used to process entire directory trees containing template files.  The\nresulting output from processing each file is then written to a corresponding file in a\ndestination directory.  The script compares the modification times of source and destination\nfiles (where they already exist) and processes only those files that have been modified.  In\nother words, it is the equivalent of 'make' for the Template Toolkit.\n\nIt supports a number of options which can be used to configure behaviour, define locations\nand set Template Toolkit options.  The script first reads the .ttreerc configuration file in\nthe HOME directory, or an alternative file specified in the TTREERC environment variable.\nThen, it processes any command line arguments, including any additional configuration files\nspecified via the \"-f\" (file) option.\n\nThe .ttreerc Configuration File\nWhen you run ttree for the first time it will ask you if you want it to create a .ttreerc\nfile for you.  This will be created in your home directory.\n\n$ ttree\nDo you want me to create a sample '.ttreerc' file for you?\n(file: /home/abw/.ttreerc)   [y/n]: y\n/home/abw/.ttreerc created.  Please edit accordingly and re-run ttree\n\nThe purpose of this file is to set any global configuration options that you want applied\nevery time ttree is run. For example, you can use the \"ignore\" and \"copy\" / \"link\" options to\nprovide regular expressions that specify which files should be ignored and which should be\ncopied or linked rather than being processed as templates.  You may also want to set flags\nlike \"verbose\" and \"recurse\" according to your preference.\n\nA minimal .ttreerc:\n\n# ignore these files\nignore = \\b(CVS|RCS)\\b\nignore = ^#\nignore = ~$\n\n# copy these files\ncopy   = \\.(gif|png|jpg|pdf)$\n\n# recurse into directories\nrecurse\n\n# provide info about what's going on\nverbose\n\nIn most cases, you'll want to create a different ttree configuration file for each project\nyou're working on.  The \"cfg\" option allows you to specify a directory where ttree can find\nfurther configuration files.\n\ncfg = /home/abw/.ttree\n\nThe \"-f\" command line option can be used to specify which configuration file should be used.\nYou can specify a filename using an absolute or relative path:\n\n$ ttree -f /home/abw/web/example/etc/ttree.cfg\n$ ttree -f ./etc/ttree.cfg\n$ ttree -f ../etc/ttree.cfg\n\nIf the configuration file does not begin with \"/\" or \".\" or something that looks like a MS-\nDOS absolute path (e.g. \"C:\\\\etc\\\\ttree.cfg\") then ttree will look for it in the directory\nspecified by the \"cfg\" option.\n\n$ ttree -f test1          # /home/abw/.ttree/test1\n\nThe \"cfg\" option can only be used in the .ttreerc file.  All the other options can be used in\nthe .ttreerc or any other ttree configuration file.  They can all also be specified as\ncommand line options.\n\nRemember that .ttreerc is always processed before any configuration file specified with the\n\"-f\" option.  Certain options like \"lib\" can be used any number of times and accumulate their\nvalues.\n\nFor example, consider the following configuration files:\n\n/home/abw/.ttreerc:\n\ncfg = /home/abw/.ttree\nlib = /usr/local/tt2/templates\n\n/home/abw/.ttree/myconfig:\n\nlib = /home/abw/web/example/templates/lib\n\nWhen ttree is invoked as follows:\n\n$ ttree -f myconfig\n\nthe \"lib\" option will be set to the following directories:\n\n/usr/local/tt2/templates\n/home/abw/web/example/templates/lib\n\nAny templates located under /usr/local/tt2/templates will be used in preference to those\nlocated under /home/abw/web/example/templates/lib.  This may be what you want, but then\nagain, it might not.  For this reason, it is good practice to keep the .ttreerc as simple as\npossible and use different configuration files for each ttree project.\n",
                "subsections": [
                    {
                        "name": "Directory Options",
                        "content": "The \"src\" option is used to define the directory containing the source templates to be\nprocessed.  It can be provided as a command line option or in a configuration file as shown\nhere:\n\nsrc = /home/abw/web/example/templates/src\n\nEach template in this directory typically corresponds to a single web page or other document.\n\nThe \"dest\" option is used to specify the destination directory for the generated output.\n\ndest = /home/abw/web/example/html\n\nThe \"lib\" option is used to define one or more directories containing additional library\ntemplates.  These templates are not documents in their own right and typically comprise of\nsmaller, modular components like headers, footers and menus that are incorporated into pages\ntemplates.\n\nlib = /home/abw/web/example/templates/lib\nlib = /usr/local/tt2/templates\n\nThe \"lib\" option can be used repeatedly to add further directories to the search path.\n\nA list of templates can be passed to ttree as command line arguments.\n\n$ ttree foo.html bar.html\n\nIt looks for these templates in the \"src\" directory and processes them through the Template\nToolkit, using any additional template components from the \"lib\" directories.  The generated\noutput is then written to the corresponding file in the \"dest\" directory.\n\nIf ttree is invoked without explicitly specifying any templates to be processed then it will\nprocess every file in the \"src\" directory.  If the \"-r\" (recurse) option is set then it will\nadditionally iterate down through sub-directories and process and other template files it\nfinds therein.\n\n$ ttree -r\n\nIf a template has been processed previously, ttree will compare the modification times of the\nsource and destination files.  If the source template (or one it is dependant on) has not\nbeen modified more recently than the generated output file then ttree will not process it.\nThe -a (all) option can be used to force ttree to process all files regardless of\nmodification time.\n\n$ tree -a\n\nAny templates explicitly named as command line argument are always processed and the\nmodification time checking is bypassed.\n"
                    },
                    {
                        "name": "File Options",
                        "content": "The \"ignore\", \"copy\", \"link\" and \"accept\" options are used to specify Perl regexen to filter\nfile names. Files that match any of the \"ignore\" options will not be processed. Remaining\nfiles that match any of the \"copy\" or \"link\" regexen will be copied or linked to the\ndestination directory. Remaining files that then match any of the \"accept\" criteria are then\nprocessed via the Template Toolkit. If no \"accept\" parameter is specified then all files will\nbe accepted for processing if not already copied or ignored.\n\n# ignore these files\nignore = \\b(CVS|RCS)\\b\nignore = ^#\nignore = ~$\n\n# copy these files\ncopy   = \\.(gif|png|jpg|pdf)$\n\n# accept only .tt2 templates\naccept = \\.tt2$\n\nThe \"suffix\" option is used to define mappings between the file extensions for source\ntemplates and the generated output files.  The following example specifies that source\ntemplates with a \".tt2\" suffix should be output as \".html\" files:\n\nsuffix tt2=html\n\nOr on the command line,\n\n--suffix tt2=html\n\nYou can provide any number of different suffix mappings by repeating this option.\n\nThe \"binmode\" option is used to set the encoding of the output file.  For example use\n\"--binmode=:utf8\" to set the output format to unicode.\n"
                    },
                    {
                        "name": "Template Dependencies",
                        "content": "The \"depend\" and \"dependfile\" options allow you to specify how any given template file\ndepends on another file or group of files.  The \"depend\" option is used to express a single\ndependency.\n\n$ ttree --depend foo=bar,baz\n\nThis command line example shows the \"--depend\" option being used to specify that the foo file\nis dependant on the bar and baz templates.  This option can be used many time on the command\nline:\n\n$ ttree --depend foo=bar,baz --depend crash=bang,wallop\n\nor in a configuration file:\n\ndepend foo=bar,baz\ndepend crash=bang,wallop\n\nThe file appearing on the left of the \"=\" is specified relative to the \"src\" or \"lib\"\ndirectories.  The file(s) appearing on the right can be specified relative to any of these\ndirectories or as absolute file paths.\n\nFor example:\n\n$ ttree --depend foo=bar,/tmp/baz\n\nTo define a dependency that applies to all files, use \"*\" on the left of the \"=\".\n\n$ ttree --depend *=header,footer\n\nor in a configuration file:\n\ndepend *=header,footer\n\nAny templates that are defined in the \"preprocess\", \"postprocess\", \"process\" or \"wrapper\"\noptions will automatically be added to the list of global dependencies that apply to all\ntemplates.\n\nThe \"dependfile\" option can be used to specify a file that contains dependency information.\n\n$ ttree --dependfile=/home/abw/web/example/etc/ttree.dep\n\nHere is an example of a dependency file:\n\n# This is a comment. It is ignored.\n\nindex.html: header footer menubar\n\nheader: titlebar hotlinks\n\nmenubar: menuitem\n\n# spanning multiple lines with the backslash\nanother.html: header footer menubar \\\nsidebar searchform\n\nLines beginning with the \"#\" character are comments and are ignored.  Blank lines are also\nignored.  All other lines should provide a filename followed by a colon and then a list of\ndependant files separated by whitespace, commas or both.  Whitespace around the colon is also\noptional.  Lines ending in the \"\\\" character are continued onto the following line.\n\nFiles that contain spaces can be quoted. That is only necessary for files after the colon\n(':'). The file before the colon may be quoted if it contains a colon.\n\nAs with the command line options, the \"*\" character can be used as a wildcard to specify a\ndependency for all templates.\n\n* : config,header\n"
                    },
                    {
                        "name": "Template Toolkit Options",
                        "content": "ttree also provides access to the usual range of Template Toolkit options.  For example, the\n\"--prechomp\" and \"--postchomp\" ttree options correspond to the \"PRECHOMP\" and \"POSTCHOMP\"\noptions.\n\nRun \"ttree -h\" for a summary of the options available.\n"
                    }
                ]
            },
            "AUTHORS": {
                "content": "Andy Wardley <abw@andywardley.com>\n\n<http://www.andywardley.com/>\n\nWith contributions from Dylan William Hardison (support for dependencies), Bryce Harrington\n(\"absolute\" and \"relative\" options), Mark Anderson (\"suffix\" and \"debug\" options), Harald\nJoerg and Leon Brocard who gets everywhere, it seems.\n",
                "subsections": []
            },
            "VERSION": {
                "content": "2.68, distributed as part of the Template Toolkit version 2.19, released on 27 April 2007.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (C) 1996-2007 Andy Wardley.  All Rights Reserved.\n\nThis module is free software; you can redistribute it and/or modify it under the same terms\nas Perl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "tpage\n\n\n\nperl v5.34.0                                 2026-05-30                                    TTREE(1p)",
                "subsections": []
            }
        }
    }
}