Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

commit for 2.14a

git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@944 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information...
commit d56b9a8c43c1876ac655d0d87efc9c459ab5dc65 1 parent c20e413
@abw authored
Showing with 1,948 additions and 3,678 deletions.
  1. +2 −2 HACKING
  2. +14 −92 INSTALL
  3. +1 −9 MANIFEST
  4. +3 −15 Makefile.PL
  5. +20 −149 README
  6. +1 −1  TODO
  7. +2 −5 bin/tpage
  8. +3 −3 bin/ttree
  9. +3 −314 docs/lib/docset/config
  10. +2 −2 docs/src/FAQ/FAQ.html
  11. +2 −2 docs/src/Library/HTML.html
  12. +2 −2 docs/src/Library/PostScript.html
  13. +2 −2 docs/src/Library/Splash.html
  14. +59 −29 docs/src/Manual/Config.html
  15. +20 −62 docs/src/Manual/Credits.html
  16. +60 −22 docs/src/Manual/Directives.html
  17. +24 −67 docs/src/Manual/Filters.html
  18. +1 −1  docs/src/Manual/Internals.html
  19. +1 −1  docs/src/Manual/Intro.html
  20. +15 −208 docs/src/Manual/Plugins.html
  21. +1 −1  docs/src/Manual/Refs.html
  22. +1 −1  docs/src/Manual/Syntax.html
  23. +55 −6 docs/src/Manual/VMethods.html
  24. +134 −102 docs/src/Manual/Variables.html
  25. +1 −1  docs/src/Manual/Views.html
  26. +17 −11 docs/src/Modules/Template.html
  27. +2 −2 docs/src/Modules/Template/Base.html
  28. +2 −2 docs/src/Modules/Template/Config.html
  29. +2 −2 docs/src/Modules/Template/Constants.html
  30. +2 −2 docs/src/Modules/Template/Context.html
  31. +4 −4 docs/src/Modules/Template/Document.html
  32. +2 −2 docs/src/Modules/Template/Exception.html
  33. +25 −68 docs/src/Modules/Template/Filters.html
  34. +2 −2 docs/src/Modules/Template/Iterator.html
  35. +2 −2 docs/src/Modules/Template/Namespace/Constants.html
  36. +14 −6 docs/src/Modules/Template/Parser.html
  37. +2 −2 docs/src/Modules/Template/Plugin.html
  38. +1 −1  docs/src/Modules/Template/Plugin/Autoformat.html
  39. +2 −2 docs/src/Modules/Template/Plugin/CGI.html
  40. +2 −2 docs/src/Modules/Template/Plugin/Datafile.html
  41. +2 −2 docs/src/Modules/Template/Plugin/Date.html
  42. +2 −2 docs/src/Modules/Template/Plugin/Directory.html
  43. +2 −2 docs/src/Modules/Template/Plugin/Dumper.html
  44. +26 −26 docs/src/Modules/Template/Plugin/File.html
  45. +2 −2 docs/src/Modules/Template/Plugin/Filter.html
  46. +2 −2 docs/src/Modules/Template/Plugin/Format.html
  47. +2 −2 docs/src/Modules/Template/Plugin/HTML.html
  48. +38 −10 docs/src/Modules/Template/Plugin/Image.html
  49. +2 −2 docs/src/Modules/Template/Plugin/Iterator.html
  50. +2 −2 docs/src/Modules/Template/Plugin/Math.html
  51. +2 −2 docs/src/Modules/Template/Plugin/Pod.html
  52. +2 −2 docs/src/Modules/Template/Plugin/Procedural.html
  53. +22 −2 docs/src/Modules/Template/Plugin/String.html
  54. +2 −2 docs/src/Modules/Template/Plugin/Table.html
  55. +13 −11 docs/src/Modules/Template/Plugin/URL.html
  56. +2 −2 docs/src/Modules/Template/Plugin/View.html
  57. +2 −2 docs/src/Modules/Template/Plugin/Wrap.html
  58. +63 −226 docs/src/Modules/Template/Plugins.html
  59. +2 −2 docs/src/Modules/Template/Provider.html
  60. +2 −2 docs/src/Modules/Template/Service.html
  61. +3 −3 docs/src/Modules/Template/Stash.html
  62. +2 −2 docs/src/Modules/Template/Stash/Context.html
  63. +1 −1  docs/src/Modules/Template/Stash/XS.html
  64. +2 −2 docs/src/Modules/Template/Test.html
  65. +0 −176 docs/src/Modules/index.html
  66. +257 −11 docs/src/Release/Changes.html
  67. +2 −2 docs/src/Release/HACKING.html
  68. +14 −92 docs/src/Release/INSTALL.html
  69. +20 −149 docs/src/Release/README.html
  70. +1 −1  docs/src/Release/TODO.html
  71. +2 −2 docs/src/Tools/tpage.html
  72. +2 −2 docs/src/Tools/ttree.html
  73. +1 −1  docs/src/Tutorial/Datafile.html
  74. +1 −1  docs/src/Tutorial/Web.html
  75. +1 −1  docs/src/Tutorial/index.html
  76. +1 −1  docs/src/index.html
  77. +1 −1  docsrc/lib/misc/copy
  78. +17 −11 docsrc/pod/Template.pod
  79. +37 −7 docsrc/src/Release/Changes.tt2
  80. +6 −67 docsrc/src/Release/INSTALL.tt2
  81. +0 −421 docsrc/xml/ttdocs.xml
  82. +2 −2 lib/Template/Base.pm
  83. +4 −4 lib/Template/Config.pm
  84. +2 −2 lib/Template/Constants.pm
  85. +2 −2 lib/Template/Context.pm
  86. +4 −4 lib/Template/Document.pm
  87. +2 −2 lib/Template/Exception.pm
  88. +3 −3 lib/Template/FAQ.pod
  89. +23 −9 lib/Template/Filters.pm
  90. +2 −2 lib/Template/Iterator.pm
  91. +3 −3 lib/Template/Library/HTML.pod
  92. +3 −3 lib/Template/Library/PostScript.pod
  93. +3 −3 lib/Template/Library/Splash.pod
  94. +1 −1  lib/Template/Manual.pod
  95. +59 −32 lib/Template/Manual/Config.pod
  96. +18 −62 lib/Template/Manual/Credits.pod
  97. +58 −24 lib/Template/Manual/Directives.pod
  98. +23 −67 lib/Template/Manual/Filters.pod
  99. +1 −1  lib/Template/Manual/Internals.pod
  100. +1 −1  lib/Template/Manual/Intro.pod
  101. +14 −196 lib/Template/Manual/Plugins.pod
  102. +1 −1  lib/Template/Manual/Refs.pod
  103. +1 −1  lib/Template/Manual/Syntax.pod
  104. +52 −7 lib/Template/Manual/VMethods.pod
  105. +133 −102 lib/Template/Manual/Variables.pod
  106. +1 −1  lib/Template/Manual/Views.pod
  107. +1 −133 lib/Template/Modules.pod
  108. +2 −2 lib/Template/Namespace/Constants.pm
  109. +13 −6 lib/Template/Parser.pm
  110. +2 −2 lib/Template/Plugin.pm
  111. +1 −1  lib/Template/Plugin/Autoformat.pm
  112. +2 −2 lib/Template/Plugin/CGI.pm
  113. +2 −2 lib/Template/Plugin/Datafile.pm
  114. +2 −2 lib/Template/Plugin/Date.pm
  115. +2 −2 lib/Template/Plugin/Directory.pm
  116. +2 −2 lib/Template/Plugin/Dumper.pm
  117. +55 −55 lib/Template/Plugin/File.pm
  118. +2 −2 lib/Template/Plugin/Filter.pm
  119. +2 −2 lib/Template/Plugin/Format.pm
  120. +2 −2 lib/Template/Plugin/HTML.pm
  121. +38 −11 lib/Template/Plugin/Image.pm
  122. +2 −2 lib/Template/Plugin/Iterator.pm
  123. +2 −2 lib/Template/Plugin/Math.pm
  124. +2 −2 lib/Template/Plugin/Pod.pm
  125. +2 −2 lib/Template/Plugin/Procedural.pm
  126. +22 −2 lib/Template/Plugin/String.pm
  127. +2 −2 lib/Template/Plugin/Table.pm
  128. +12 −12 lib/Template/Plugin/URL.pm
  129. +2 −2 lib/Template/Plugin/View.pm
  130. +2 −2 lib/Template/Plugin/Wrap.pm
  131. +50 −20 lib/Template/Plugins.pm
  132. +2 −2 lib/Template/Provider.pm
  133. +2 −2 lib/Template/Service.pm
  134. +4 −4 lib/Template/Stash.pm
  135. +2 −2 lib/Template/Stash/Context.pm
  136. +1 −1  lib/Template/Stash/XS.pm
  137. +14 −14 lib/Template/Test.pm
  138. +2 −2 lib/Template/Tools/tpage.pod
  139. +2 −2 lib/Template/Tools/ttree.pod
  140. +6 −6 lib/Template/Tutorial.pod
  141. +1 −1  lib/Template/Tutorial/Datafile.pod
  142. +6 −6 lib/Template/Tutorial/Web.pod
  143. +0 −82 t/latex2dvi.t
  144. +0 −82 t/latex2pdf.t
  145. +0 −83 t/latex2ps.t
  146. +152 −0 t/pod.t
  147. +0 −112 t/rss.t
  148. +1 −0  t/stash-xs.t
  149. +25 −0 t/test/pod/test1.pod
  150. +13 −0 t/vmeth.t
View
4 HACKING
@@ -1,9 +1,9 @@
Template Toolkit
- Version 2.13
+ Version 2.15
- 30 January 2004
+ 30 January 2006
Copyright (C) 1996-2004 Andy Wardley. All Rights Reserved
Copyright (C) 1998-2002 Canon Research Centre Europe Ltd.
View
106 INSTALL
@@ -1,9 +1,9 @@
Template Toolkit
- Version 2.13
+ Version 2.15
- 30 January 2004
+ 30 January 2006
Copyright (C) 1996-2004 Andy Wardley. All Rights Reserved
Copyright (C) 1998-2002 Canon Research Centre Europe Ltd.
@@ -18,32 +18,15 @@ The latest version of the Template Toolkit can be retrieved from:
http://www.cpan.org/modules/by-module/Template/
-Fetch and install AppConfig 1.55 if you don't already have it installed.
+Fetch and install AppConfig 1.56 if you don't already have it installed.
Available from CPAN in:
http://www.cpan.org/authors/Andy_Wardley/
-The following modules are optional. If you have them installed then
-you will be able to access them via the appropriate Template Toolkit
-plugins. If you don't have them and don't want them, then there's no
-need to install them. They're all available from CPAN if you do.
-
- Text::Autoformat 1.03+
- DBI 1.14+ (and relevant DBD drivers)
- GD 1.32+
- GD::Text 0.80+
- GD::Graph 1.33+
- GD::Graph3d 0.55+
- Pod::POM 0.1+
- XML::Parser 2.23+
- XML::DOM 1.27+ (in libxml-enno)
- XML::RSS 0.9+
- XML::XPath 1.00+
-
To install the Template Toolkit:
- tar zxf Template-Toolkit-2.13.tar.gz
- cd Template-Toolkit-2.13
+ tar zxf Template-Toolkit-2.15.tar.gz
+ cd Template-Toolkit-2.15
perl Makefile.PL
make
make test
@@ -81,34 +64,10 @@ available from CPAN:
The Template Toolkit implements a "plugin" architecture which allow
you to incorporate the functionality of virtually any Perl module into
your templates. A number of plugin modules are included with the
-distribution for interfacing to databases (DBI), XML files (XML::DOM,
-XML::RSS, XML::XPath), CGI scripts (CGI), and so on. Some of these
-plugin modules are dependant on external modules but these are not
-pre-requisites for installation. All plugin modules are installed,
-regardless of any unsatisfied dependencies, so that you can install an
-external module at a later date and then use the plugin without
-requiring re-installation of the Template Toolkit.
-
-If you want to enable all plugin modules then the following modules,
-all available from CPAN, should be installed:
-
- Plugin Requires
- ------ --------
- Autoformat Text::Autoformat 1.03+
- DBI DBI 1.14+ and relevant DBD drivers
- GD GD 1.32+
- GD::Text GD::Text 0.80+
- GD::Graph GD::Graph 1.33+
- GD::Graph::lines3d GD::Graph3d 0.55+
- Pod Pod::POM 0.1+
- XML::DOM XML::DOM 1.27+ (requires XML::Parser 2.23+)
- XML::RSS XML::RSS 0.9+ (ditto)
- XML::XPath XML::XPath 1.00+ (ditto)
-
-NOTES:
-
- * XML::DOM can be found in the 'libxml-enno' distribution, available
- from http://www.cpan.org/modules/by-module/XML/
+distribution for adding extra functionality or interfacing to external
+CPAN modules. You don't need to install any of these external modules
+unless you plan to use those particular plugins. See Template::Plugins
+and Template::Manual::Plugins for further details.
OBTAINING AND INSTALLING THE TEMPLATE TOOLKIT
@@ -129,19 +88,19 @@ The Template Toolkit is distributed as a gzipped tar archive file:
Template-Toolkit-<version>.tar.gz
-where <version> represents the current version number, e.g. 2.13.
+where <version> represents the current version number, e.g. 2.15.
To install the Template Toolkit, unpack the distribution archive to
create an installation directory. Something like this:
- tar zxf Template-Toolkit-2.13.tar.gz
+ tar zxf Template-Toolkit-2.15.tar.gz
or
- gunzip Template-Toolkit-2.13.tar.gz
- tar xf Template-Toolkit-2.13.tar
+ gunzip Template-Toolkit-2.15.tar.gz
+ tar xf Template-Toolkit-2.15.tar
You can then 'cd' into the directory created,
- cd Template-Toolkit-2.13
+ cd Template-Toolkit-2.15
and perform the usual Perl installation procedure:
@@ -201,19 +160,6 @@ install the Template Toolkit.
perl Makefile.PL
-It first determines which modules you have installed to configure the
-test suite accordingly. If you have the DBI module installed then it
-will ask you if you want to run the DBI tests.
-
- Do you want to run the DBI tests?\n" .
- It requires access to an existing test database. [y]
-
-If you answer 'y' then it will prompt you for the DBD driver and the
-data source parameters (name, user, password) required to connect to
-the relevant database. Please ensure that your database server is
-running and that the database you specify exists before executing
-'make test' (otherwise, expect a failure for the t/dbi.t test).
-
The Template Toolkit now boasts a high-speed implementation of
Template::Stash written in XS. You can choose to build this as
an optional module for using explicitly as an alternative to
@@ -227,30 +173,6 @@ the XS Stash module by default:
Do you want to build the XS Stash module? [y]
Do you want to use the XS Stash for all Templates? [n]
-The latex filter, new to release 2.03, allows you to generate
-PostScript, PDF and DVI files directly from LaTeX source templates.
-It relies on 3 external programs which the Makefile.PL script
-will attempt to locate. You will then be prompted to enable or
-disable the latex filter:
-
- TT2 supports PDF, DVI and PostScript output using the latex
- filter, implemented with the programs pdflatex, latex and dvips.
-
- Because the latex filter runs latex and pdflatex, template authors
- could use this feature to include any arbitrary file in their
- latex input, or also open an arbitrary output file, independent of
- the ABSOLUTE or RELATIVE configuration settings. This might create
- a security concern at your site. If you don't trust your template
- authors then don't enable the latex filter.
-
- I found the following locations for pdflatex, latex and dvips:
- + pdflatex => /usr/bin/pdflatex
- + latex => /usr/bin/latex
- + dvips => /usr/bin/dvips
-
- Do you want to enable the latex filter? [y]
- Are the pdflatex, latex and dvips paths ok? [y]
-
In additional to the Perl modules and POD documentation installed in
the usual way, the Template Toolkit distribution also contains a
number of optional components.
View
10 MANIFEST
@@ -467,7 +467,6 @@ t/proc.t
t/process.t
t/provider.t
t/ref.t
-t/rss.t
t/service.t
t/skel.t
t/stash-xs.t
@@ -531,20 +530,12 @@ t/test/src/leak2
t/test/src/metadata
t/test/src/mywrap
t/test/src/recurse
-t/test/src/one
-t/test/src/one
-t/test/src/two
-t/test/src/three
-t/test/src/four
t/test/tmp/README
-t/test/xml/example.rdf
-t/test/xml/testfile.xml
t/text.t
t/throw.t
t/tiedhash.t
t/try.t
t/url.t
-t/url2.t
t/vars.t
t/varsv1.t
t/view.t
@@ -641,3 +632,4 @@ xs/Makefile.PL
xs/README
xs/Stash.xs
xs/ppport.h
+META.yml Module meta-data (added by MakeMaker)
View
18 Makefile.PL
@@ -155,7 +155,7 @@ my $SPLASH_STYLES = {
# define version numbers of required modules
-my $TT_APPCONFIG_VERSION = '1.55';
+my $TT_APPCONFIG_VERSION = '1.56';
my $TT_FILE_SPEC_VERSION = '0.8';
my $TT_FILE_TEMP_VERSION = '0.12';
@@ -416,20 +416,8 @@ the regular Template::Stash written in Perl. If you've got a C
compiler on your system then you can elect to have the XS Stash built.
You can also specify that you want to use the XS Stash by default.
-Please note that the XS Stash doesn't support access to tied hashes or
-tied lists (e.g. Tie::DBI). If you're using tied objects then you'll
-need to explicitly tell the Template Toolkit that you want to use the
-Perl version. You can specify which stash module you want by setting
-the \$Template::Config::STASH package variable.
-
- use Template;
- use Template::Config;
-
- \$Template::Config::STASH = 'Template::Stash';
- \$tt = Template->new(); # uses Perl stash
-
- \$Template::Config::STASH = 'Template::Stash::XS';
- \$tt = Template->new(); # uses XS stash
+Note that as of version 2.15 the XS Stash now supports access to tied
+hashes and arrays.
See 'perldoc Template::Config' for further details.
View
169 README
@@ -1,9 +1,9 @@
Template Toolkit
- Version 2.13
+ Version 2.15
- 30 January 2004
+ 30 January 2006
Copyright (C) 1996-2004 Andy Wardley. All Rights Reserved
Copyright (C) 1998-2002 Canon Research Centre Europe Ltd.
@@ -19,32 +19,15 @@ The latest version of the Template Toolkit can be retrieved from:
http://www.cpan.org/modules/by-module/Template/
-Fetch and install AppConfig 1.55 if you don't already have it installed.
+Fetch and install AppConfig 1.56 if you don't already have it installed.
Available from CPAN in:
http://www.cpan.org/authors/Andy_Wardley/
-The following modules are optional. If you have them installed then
-you will be able to access them via the appropriate Template Toolkit
-plugins. If you don't have them and don't want them, then there's no
-need to install them. They're all available from CPAN if you do.
-
- Text::Autoformat 1.03+
- DBI 1.14+ (and relevant DBD drivers)
- GD 1.32+
- GD::Text 0.80+
- GD::Graph 1.33+
- GD::Graph3d 0.55+
- Pod::POM 0.1+
- XML::Parser 2.23+
- XML::DOM 1.27+ (in libxml-enno)
- XML::RSS 0.9+
- XML::XPath 1.00+
-
To install the Template Toolkit:
- tar zxf Template-Toolkit-2.13.tar.gz
- cd Template-Toolkit-2.13
+ tar zxf Template-Toolkit-2.15.tar.gz
+ cd Template-Toolkit-2.15
perl Makefile.PL
make
make test
@@ -82,73 +65,28 @@ content. A number of Perl scripts are also provided which can greatly
simplify the process of creating and managing static web content and
other offline document systems.
-Version 2 is a near-total rewrite which adds many new features while
-remaining *almost* fully backwardly compatible with version 1 (see
-'VERSION COMPATABILITY' below). The internal design and
-architecture have been greatly improved and the template language
-offers a number of powerful new directives, while retaining all but
-the broken, buggy, undocumented or experimental features that had
-crept into versions 0.* and 1.* over the years. Version 2 also offers
-important performance benefits, running significantly faster and using
-less memory than version 1. This can only be described as a Good
-Thing.
-
-The Template Toolkit (version 1) received the award for "Best New Perl
-Module" at the 4th Perl Conference in Monterey last year (2000).
-Version 2 is even better and if it doesn't make your content funkier,
-your job easier, your life more fun and you more attractive to the
-appropriate sex, then you can always return it for a full refund. :-)
-
WHAT'S NEW?
-----------
-Version 2.13 followed on quickly from 2.13 to fix a minor, but
-annoying bug in the date.t test script that we thought we had
-fixed in 2.12 but hadn't.
-
-Version 2.12 followed on quickly from 2.11 to fix a minor, but
-annoying bug in the date.t test script.
-
-Version 2.11 includes a number of enhancements to ttree, and several
-minor bug fixes. It also improves on how runtime errors and warnings
-are reported, by adding the template file and line number to the
-message generated.
-
-Version 2.10 provided a few trivial new features and applies fixes to
-some small bugs. For example, you can now use IN instead of = in a
-loop, e.g. FOREACH item IN list. The WRAPPER configuration option is
-new, and Template::Context and Template::Stash now both implement
-define_vmethod() methods which make it easier to define new virtual
-methods.
-
-Version 2.09 contained mostly bug fixes and minor enhancements.
+Version 2.15 features a number of enhancements to the XS Stash that
+includes support for tied hashes and arrays. There are numerous other
+bug fixes and enhancements, described in detail in the Changes file.
-Version 2.08 added compile time constant folding which can result in a
-significant performance boost when processing templates. It also
-offered several other minor enhancements and bug fixes.
+More significant is what's not in version 2.15. The DBI plugin has
+been moved into a separate Template-DBI distribution, the GD plugins
+into Template-GD, the XML plugins into Template-XML, and the Latex
+filters into Template-Latex. This has been done in an effort to make
+the Template Toolkit core distribution smaller, cleaner and easier to
+configure and install.
-Version 2.07 was a major maintenance release, fixing numerous minor bugs
-and smoothing out various rough edges. Version 2.06 was a very minor
-bug release version.
+Version 2.14 added Unicode support to TT, a full set of command line
+options for tpage, the 'caller' and 'callers' items to each template
+component, some enhancements to the XML::Simple plugin, and a number
+of minor bug fixes.
-The most exciting new feature in version 2.05 was Doug Steinwand's
-high-speed drop-in replacement for Template::Stash written in
-Perl XS. With this in place, the Template Toolkit typically runs
-twice as fast as before!
-
-Pretty much everything else in 2.05 and 2.04 before it consisted
-of minor bug fixes and improvements.
-
-Version 2.03 included Craig Barratt's 'latex' filter and GD plugins
-and Dave Cross's tutorial on using the Template Toolkit for creating
-and reusing XML data files.
-
-Version 2.02 was another bugfix release.
-
-Version 2.01 was a major release containing new filters, plugins,
-template libraries, the experimental VIEW directive, and a total
-overhaul of the documentation.
+See the Changes file for further details of the changes in these and
+earlier releases.
GENERAL FEATURES
@@ -226,17 +164,6 @@ using 'perldoc', e.g.
perldoc Template
-IMPORTANT NOTE: if you've had a previous verion of the Template
-Toolkit installed (e.g. version 2.00) then perldoc might be displaying
-an old version of the Pod documentation. This is because previous
-versions distributed the Pod in separate .pod files but it's now
-living back inside the relevant .pm files. Alas, perldoc selects the
-older .pod files in preference over the newer .pm. The only solution
-at present is to manually delete all the older .pod files in the
-Template part of your Perl installation directory. Of course, if I had
-thought of this back when I decided to move all the .pod back into the
-.pm files...
-
If you're using a Unix based system then the pages should also be
converted to manpages suring the 'make install'. Thus, you can also:
@@ -353,62 +280,6 @@ For information about commercial support and consultancy for the Template
Toolkit, please contact the author.
-VERSION COMPATABILITY
----------------------
-
-In terms of the template language and features available, versions
-2.01 through to 2.13 should be fully backwardly compatible with
-version 2.00.
-
-Version 2.00 is backwardly compatible with version 1 in all but a few
-minor areas. The 'Changes' file details all the visible changes
-between version 1 and version 2, including deltas between alphas and
-betas. Within this file there is a 'Gotchas' section which lists the
-changes that may affect backwards compatability with existing template
-files. These are listed in brief below. Please consult the 'Changes'
-file for full details.
-
-* All directive keywords should now be written in UPPER CASE (by default)
- to avoid conflict with reserved words. The CASE option is now called
- ANYCASE and can be set true to permit lower case directive keywords.
-
-* CATCH blocks must now be scoped with a TRY block.
-
-* The ERROR directive is no longer supported. THROW an exception instead
- or use the 'stderr' filter if you really must write to STDERR and nowhere
- else.
-
-* The ERROR configuration option (previously used to customise the ERROR
- directive) is now used to specify handling for uncaught exceptions.
-
-* Version 1 allowed (but didn't recommend) the use of a leading '$' on a
- variable name (i.e. like Perl) which was silently ignored. Version 2
- no longer ignores them and treats it as a variable
- pre-interpolation. Most of the time you *don't* want to do this, so
- don't add a leading '$' unless you know what you're doing. You can set
- V1DOLLAR => 1 to revert to the old behaviour if you really have to.
-
-* The default tag style for version 1 accepted [% ... %] or %% ... %%
- (the latter for backwards compatability with Text::MetaText, the
- predecessor to TT). Version 2 now only accepts [% ... %] by default.
- You can set TAG_STYLE => 'template1' to get both.
-
-* The 'into' filter is obsolete. You can now simply assign the output
- of a directive into a variable, e.g. [% foo = INCLUDE header %]
-
-* The IMPORT directive has been removed and replaced by an 'import'
- hash method.
-
-Most of the significant changes are in the internals of the Template
-Toolkit. If you have any v1 code that delves into the individual
-modules and tinkers with their guts then will need to check the
-'Changes' file very carefully indeed and re-evaluate your code in the
-light of the new architecture. The internals are cleaner and better
-organised making extension code much easier to write. The downside is
-that some of the old and crusty ways you previously had to do things
-may no longer work.
-
-
AUTHOR
------
View
2  TODO
@@ -3,7 +3,7 @@
# TODO
#
# DESCRIPTION
-# TODO list for the Template Toolkit version 2.13, containing
+# TODO list for the Template Toolkit version 2.15, containing
# known bugs, limitations, planned enhancements, long term visions
# and a few whacky ideas.
#
View
7 bin/tpage
@@ -174,9 +174,6 @@ END_OF_HELP
exit(0);
}
-
-
-
__END__
@@ -231,8 +228,8 @@ L<http://www.andywardley.com/|http://www.andywardley.com/>
=head1 VERSION
-2.69, distributed as part of the
-Template Toolkit version 2.13, released on 30 January 2004.
+2.65, distributed as part of the
+Template Toolkit version 2.15, released on 30 January 2006.
=head1 COPYRIGHT
View
6 bin/ttree
@@ -48,7 +48,7 @@ my $TTMODULE = 'Template';
# offer create a sample config file if it doesn't exist, unless a '-f'
# has been specified on the command line
-unless (-f $RCFILE or grep(/^-f$/, @ARGV) ) {
+unless (-f $RCFILE or grep(/^(-f|-h|--help)$/, @ARGV) ) {
print("Do you want me to create a sample '.ttreerc' file for you?\n",
"(file: $RCFILE) [y/n]: ");
my $y = <STDIN>;
@@ -1055,8 +1055,8 @@ Brocard who gets everywhere, it seems.
=head1 VERSION
-2.35, distributed as part of the
-Template Toolkit version 2.15, released on 27 January 2006.
+2.65, distributed as part of the
+Template Toolkit version 2.15, released on 30 January 2006.
=head1 COPYRIGHT
View
317 docs/lib/docset/config
@@ -261,7 +261,7 @@ docset => {
prev => 'Manual',
next => 'Library',
- pagelist => [ 'Template', 'Base', 'Config', 'Constants', 'Context', 'Document', 'Exception', 'Filters', 'Iterator', 'Namespace_Constants', 'Parser', 'Plugin', 'Plugins', 'Provider', 'Service', 'Stash', 'Stash_Context', 'Stash_XS', 'Test', 'Plugin_Autoformat', 'Plugin_CGI', 'Plugin_DBI', 'Plugin_Datafile', 'Plugin_Date', 'Plugin_Directory', 'Plugin_Dumper', 'Plugin_File', 'Plugin_Filter', 'Plugin_Format', 'Plugin_GD_Image', 'Plugin_GD_Polygon', 'Plugin_GD_Constants', 'Plugin_GD_Text', 'Plugin_GD_Text_Align', 'Plugin_GD_Text_Wrap', 'Plugin_GD_Graph_lines', 'Plugin_GD_Graph_lines3d', 'Plugin_GD_Graph_bars', 'Plugin_GD_Graph_bars3d', 'Plugin_GD_Graph_points', 'Plugin_GD_Graph_linespoints', 'Plugin_GD_Graph_area', 'Plugin_GD_Graph_mixed', 'Plugin_GD_Graph_pie', 'Plugin_GD_Graph_pie3d', 'Plugin_HTML', 'Plugin_Image', 'Plugin_Iterator', 'Plugin_Math', 'Plugin_Pod', 'Plugin_Procedural', 'Plugin_String', 'Plugin_Table', 'Plugin_URL', 'Plugin_View', 'Plugin_Wrap', 'Plugin_XML_DOM', 'Plugin_XML_RSS', 'Plugin_XML_Simple', 'Plugin_XML_Style', 'Plugin_XML_XPath' ],
+ pagelist => [ 'Template', 'Base', 'Config', 'Constants', 'Context', 'Document', 'Exception', 'Filters', 'Iterator', 'Namespace_Constants', 'Parser', 'Plugin', 'Plugins', 'Provider', 'Service', 'Stash', 'Stash_Context', 'Stash_XS', 'Test', 'Plugin_Autoformat', 'Plugin_CGI', 'Plugin_Datafile', 'Plugin_Date', 'Plugin_Directory', 'Plugin_Dumper', 'Plugin_File', 'Plugin_Filter', 'Plugin_Format', 'Plugin_HTML', 'Plugin_Image', 'Plugin_Iterator', 'Plugin_Math', 'Plugin_Pod', 'Plugin_Procedural', 'Plugin_String', 'Plugin_Table', 'Plugin_URL', 'Plugin_View', 'Plugin_Wrap' ],
pages => {
Template => {
@@ -535,19 +535,6 @@ docset => {
about => 'Interface to the CGI module',
prev => 'Plugin_Autoformat',
- next => 'Plugin_DBI',
- },
- Plugin_DBI => {
- id => 'Plugin_DBI',
- name => 'Template::Plugin::DBI',
- title => 'Template::Plugin::DBI',
- podname => 'Template::Plugin::DBI',
- url => 'Modules/Template/Plugin/DBI.html',
- uplink => '../../..',
- author => 'abw',
- about => 'Template interface to the DBI module',
-
- prev => 'Plugin_CGI',
next => 'Plugin_Datafile',
},
Plugin_Datafile => {
@@ -560,7 +547,7 @@ docset => {
author => 'abw',
about => 'Plugin to construct records from a simple data file',
- prev => 'Plugin_DBI',
+ prev => 'Plugin_CGI',
next => 'Plugin_Date',
},
Plugin_Date => {
@@ -639,214 +626,6 @@ docset => {
about => 'Plugin to create formatting functions',
prev => 'Plugin_Filter',
- next => 'Plugin_GD_Image',
- },
- Plugin_GD_Image => {
- id => 'Plugin_GD_Image',
- name => 'Template::Plugin::GD::Image',
- title => 'Template::Plugin::GD::Image',
- podname => 'Template::Plugin::GD::Image',
- url => 'Modules/Template/Plugin/GD/Image.html',
- uplink => '../../../..',
- author => 'craig',
- about => 'Interface to GD Graphics Library',
-
- prev => 'Plugin_Format',
- next => 'Plugin_GD_Polygon',
- },
- Plugin_GD_Polygon => {
- id => 'Plugin_GD_Polygon',
- name => 'Template::Plugin::GD::Polygon',
- title => 'Template::Plugin::GD::Polygon',
- podname => 'Template::Plugin::GD::Polygon',
- url => 'Modules/Template/Plugin/GD/Polygon.html',
- uplink => '../../../..',
- author => 'craig',
- about => 'Interface to GD module Polygon class',
-
- prev => 'Plugin_GD_Image',
- next => 'Plugin_GD_Constants',
- },
- Plugin_GD_Constants => {
- id => 'Plugin_GD_Constants',
- name => 'Template::Plugin::GD::Constants',
- title => 'Template::Plugin::GD::Constants',
- podname => 'Template::Plugin::GD::Constants',
- url => 'Modules/Template/Plugin/GD/Constants.html',
- uplink => '../../../..',
- author => 'craig',
- about => 'Interface to GD module constants',
-
- prev => 'Plugin_GD_Polygon',
- next => 'Plugin_GD_Text',
- },
- Plugin_GD_Text => {
- id => 'Plugin_GD_Text',
- name => 'Template::Plugin::GD::Text',
- title => 'Template::Plugin::GD::Text',
- podname => 'Template::Plugin::GD::Text',
- url => 'Modules/Template/Plugin/GD/Text.html',
- uplink => '../../../..',
- author => 'craig',
- about => 'Text utilities for use with GD',
-
- prev => 'Plugin_GD_Constants',
- next => 'Plugin_GD_Text_Align',
- },
- Plugin_GD_Text_Align => {
- id => 'Plugin_GD_Text_Align',
- name => 'Template::Plugin::GD::Text::Align',
- title => 'Template::Plugin::GD::Text::Align',
- podname => 'Template::Plugin::GD::Text::Align',
- url => 'Modules/Template/Plugin/GD/Text/Align.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Draw aligned strings in GD images',
-
- prev => 'Plugin_GD_Text',
- next => 'Plugin_GD_Text_Wrap',
- },
- Plugin_GD_Text_Wrap => {
- id => 'Plugin_GD_Text_Wrap',
- name => 'Template::Plugin::GD::Text::Wrap',
- title => 'Template::Plugin::GD::Text::Wrap',
- podname => 'Template::Plugin::GD::Text::Wrap',
- url => 'Modules/Template/Plugin/GD/Text/Wrap.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Break and wrap strings in GD images',
-
- prev => 'Plugin_GD_Text_Align',
- next => 'Plugin_GD_Graph_lines',
- },
- Plugin_GD_Graph_lines => {
- id => 'Plugin_GD_Graph_lines',
- name => 'Template::Plugin::GD::Graph::lines',
- title => 'Template::Plugin::GD::Graph::lines',
- podname => 'Template::Plugin::GD::Graph::lines',
- url => 'Modules/Template/Plugin/GD/Graph/lines.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create line graphs with axes and legends',
-
- prev => 'Plugin_GD_Text_Wrap',
- next => 'Plugin_GD_Graph_lines3d',
- },
- Plugin_GD_Graph_lines3d => {
- id => 'Plugin_GD_Graph_lines3d',
- name => 'Template::Plugin::GD::Graph::lines3d',
- title => 'Template::Plugin::GD::Graph::lines3d',
- podname => 'Template::Plugin::GD::Graph::lines3d',
- url => 'Modules/Template/Plugin/GD/Graph/lines3d.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create 3D line graphs with axes and legends',
-
- prev => 'Plugin_GD_Graph_lines',
- next => 'Plugin_GD_Graph_bars',
- },
- Plugin_GD_Graph_bars => {
- id => 'Plugin_GD_Graph_bars',
- name => 'Template::Plugin::GD::Graph::bars',
- title => 'Template::Plugin::GD::Graph::bars',
- podname => 'Template::Plugin::GD::Graph::bars',
- url => 'Modules/Template/Plugin/GD/Graph/bars.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create bar graphs with axes and legends',
-
- prev => 'Plugin_GD_Graph_lines3d',
- next => 'Plugin_GD_Graph_bars3d',
- },
- Plugin_GD_Graph_bars3d => {
- id => 'Plugin_GD_Graph_bars3d',
- name => 'Template::Plugin::GD::Graph::bars3d',
- title => 'Template::Plugin::GD::Graph::bars3d',
- podname => 'Template::Plugin::GD::Graph::bars3d',
- url => 'Modules/Template/Plugin/GD/Graph/bars3d.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create 3D bar graphs with axes and legends',
-
- prev => 'Plugin_GD_Graph_bars',
- next => 'Plugin_GD_Graph_points',
- },
- Plugin_GD_Graph_points => {
- id => 'Plugin_GD_Graph_points',
- name => 'Template::Plugin::GD::Graph::points',
- title => 'Template::Plugin::GD::Graph::points',
- podname => 'Template::Plugin::GD::Graph::points',
- url => 'Modules/Template/Plugin/GD/Graph/points.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create point graphs with axes and legends',
-
- prev => 'Plugin_GD_Graph_bars3d',
- next => 'Plugin_GD_Graph_linespoints',
- },
- Plugin_GD_Graph_linespoints => {
- id => 'Plugin_GD_Graph_linespoints',
- name => 'Template::Plugin::GD::Graph::linespoints',
- title => 'Template::Plugin::GD::Graph::linespoints',
- podname => 'Template::Plugin::GD::Graph::linespoints',
- url => 'Modules/Template/Plugin/GD/Graph/linespoints.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create line/point graphs with axes and legends',
-
- prev => 'Plugin_GD_Graph_points',
- next => 'Plugin_GD_Graph_area',
- },
- Plugin_GD_Graph_area => {
- id => 'Plugin_GD_Graph_area',
- name => 'Template::Plugin::GD::Graph::area',
- title => 'Template::Plugin::GD::Graph::area',
- podname => 'Template::Plugin::GD::Graph::area',
- url => 'Modules/Template/Plugin/GD/Graph/area.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create area graphs with axes and legends',
-
- prev => 'Plugin_GD_Graph_linespoints',
- next => 'Plugin_GD_Graph_mixed',
- },
- Plugin_GD_Graph_mixed => {
- id => 'Plugin_GD_Graph_mixed',
- name => 'Template::Plugin::GD::Graph::mixed',
- title => 'Template::Plugin::GD::Graph::mixed',
- podname => 'Template::Plugin::GD::Graph::mixed',
- url => 'Modules/Template/Plugin/GD/Graph/mixed.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create mixed graphs with axes and legends',
-
- prev => 'Plugin_GD_Graph_area',
- next => 'Plugin_GD_Graph_pie',
- },
- Plugin_GD_Graph_pie => {
- id => 'Plugin_GD_Graph_pie',
- name => 'Template::Plugin::GD::Graph::pie',
- title => 'Template::Plugin::GD::Graph::pie',
- podname => 'Template::Plugin::GD::Graph::pie',
- url => 'Modules/Template/Plugin/GD/Graph/pie.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create pie charts with legends',
-
- prev => 'Plugin_GD_Graph_mixed',
- next => 'Plugin_GD_Graph_pie3d',
- },
- Plugin_GD_Graph_pie3d => {
- id => 'Plugin_GD_Graph_pie3d',
- name => 'Template::Plugin::GD::Graph::pie3d',
- title => 'Template::Plugin::GD::Graph::pie3d',
- podname => 'Template::Plugin::GD::Graph::pie3d',
- url => 'Modules/Template/Plugin/GD/Graph/pie3d.html',
- uplink => '../../../../..',
- author => 'craig',
- about => 'Create 3D pie charts with legends',
-
- prev => 'Plugin_GD_Graph_pie',
next => 'Plugin_HTML',
},
Plugin_HTML => {
@@ -859,7 +638,7 @@ docset => {
author => 'abw',
about => 'Plugin to create HTML elements',
- prev => 'Plugin_GD_Graph_pie3d',
+ prev => 'Plugin_Format',
next => 'Plugin_Image',
},
Plugin_Image => {
@@ -990,71 +769,6 @@ docset => {
about => 'Plugin interface to Text::Wrap',
prev => 'Plugin_View',
- next => 'Plugin_XML_DOM',
- },
- Plugin_XML_DOM => {
- id => 'Plugin_XML_DOM',
- name => 'Template::Plugin::XML::DOM',
- title => 'Template::Plugin::XML::DOM',
- podname => 'Template::Plugin::XML::DOM',
- url => 'Modules/Template/Plugin/XML/DOM.html',
- uplink => '../../../..',
- author => 'abw',
- about => 'Plugin interface to XML::DOM',
-
- prev => 'Plugin_Wrap',
- next => 'Plugin_XML_RSS',
- },
- Plugin_XML_RSS => {
- id => 'Plugin_XML_RSS',
- name => 'Template::Plugin::XML::RSS',
- title => 'Template::Plugin::XML::RSS',
- podname => 'Template::Plugin::XML::RSS',
- url => 'Modules/Template/Plugin/XML/RSS.html',
- uplink => '../../../..',
- author => 'abw',
- about => 'Plugin interface to XML::RSS',
-
- prev => 'Plugin_XML_DOM',
- next => 'Plugin_XML_Simple',
- },
- Plugin_XML_Simple => {
- id => 'Plugin_XML_Simple',
- name => 'Template::Plugin::XML::Simple',
- title => 'Template::Plugin::XML::Simple',
- podname => 'Template::Plugin::XML::Simple',
- url => 'Modules/Template/Plugin/XML/Simple.html',
- uplink => '../../../..',
- author => 'abw',
- about => 'Plugin interface to XML::Simple',
-
- prev => 'Plugin_XML_RSS',
- next => 'Plugin_XML_Style',
- },
- Plugin_XML_Style => {
- id => 'Plugin_XML_Style',
- name => 'Template::Plugin::XML::Style',
- title => 'Template::Plugin::XML::Style',
- podname => 'Template::Plugin::XML::Style',
- url => 'Modules/Template/Plugin/XML/Style.html',
- uplink => '../../../..',
- author => 'abw',
- about => 'Simple XML stylesheet transfomations',
-
- prev => 'Plugin_XML_Simple',
- next => 'Plugin_XML_XPath',
- },
- Plugin_XML_XPath => {
- id => 'Plugin_XML_XPath',
- name => 'Template::Plugin::XML::XPath',
- title => 'Template::Plugin::XML::XPath',
- podname => 'Template::Plugin::XML::XPath',
- url => 'Modules/Template/Plugin/XML/XPath.html',
- uplink => '../../../..',
- author => 'abw',
- about => 'Plugin interface to XML::XPath',
-
- prev => 'Plugin_XML_Style',
next => '',
},
@@ -1377,7 +1091,6 @@ docset => {
'Template::Test' => 'Modules/Template/Test.html',
'Template::Plugin::Autoformat' => 'Modules/Template/Plugin/Autoformat.html',
'Template::Plugin::CGI' => 'Modules/Template/Plugin/CGI.html',
- 'Template::Plugin::DBI' => 'Modules/Template/Plugin/DBI.html',
'Template::Plugin::Datafile' => 'Modules/Template/Plugin/Datafile.html',
'Template::Plugin::Date' => 'Modules/Template/Plugin/Date.html',
'Template::Plugin::Directory' => 'Modules/Template/Plugin/Directory.html',
@@ -1385,22 +1098,6 @@ docset => {
'Template::Plugin::File' => 'Modules/Template/Plugin/File.html',
'Template::Plugin::Filter' => 'Modules/Template/Plugin/Filter.html',
'Template::Plugin::Format' => 'Modules/Template/Plugin/Format.html',
- 'Template::Plugin::GD::Image' => 'Modules/Template/Plugin/GD/Image.html',
- 'Template::Plugin::GD::Polygon' => 'Modules/Template/Plugin/GD/Polygon.html',
- 'Template::Plugin::GD::Constants' => 'Modules/Template/Plugin/GD/Constants.html',
- 'Template::Plugin::GD::Text' => 'Modules/Template/Plugin/GD/Text.html',
- 'Template::Plugin::GD::Text::Align' => 'Modules/Template/Plugin/GD/Text/Align.html',
- 'Template::Plugin::GD::Text::Wrap' => 'Modules/Template/Plugin/GD/Text/Wrap.html',
- 'Template::Plugin::GD::Graph::lines' => 'Modules/Template/Plugin/GD/Graph/lines.html',
- 'Template::Plugin::GD::Graph::lines3d' => 'Modules/Template/Plugin/GD/Graph/lines3d.html',
- 'Template::Plugin::GD::Graph::bars' => 'Modules/Template/Plugin/GD/Graph/bars.html',
- 'Template::Plugin::GD::Graph::bars3d' => 'Modules/Template/Plugin/GD/Graph/bars3d.html',
- 'Template::Plugin::GD::Graph::points' => 'Modules/Template/Plugin/GD/Graph/points.html',
- 'Template::Plugin::GD::Graph::linespoints' => 'Modules/Template/Plugin/GD/Graph/linespoints.html',
- 'Template::Plugin::GD::Graph::area' => 'Modules/Template/Plugin/GD/Graph/area.html',
- 'Template::Plugin::GD::Graph::mixed' => 'Modules/Template/Plugin/GD/Graph/mixed.html',
- 'Template::Plugin::GD::Graph::pie' => 'Modules/Template/Plugin/GD/Graph/pie.html',
- 'Template::Plugin::GD::Graph::pie3d' => 'Modules/Template/Plugin/GD/Graph/pie3d.html',
'Template::Plugin::HTML' => 'Modules/Template/Plugin/HTML.html',
'Template::Plugin::Image' => 'Modules/Template/Plugin/Image.html',
'Template::Plugin::Iterator' => 'Modules/Template/Plugin/Iterator.html',
@@ -1412,11 +1109,6 @@ docset => {
'Template::Plugin::URL' => 'Modules/Template/Plugin/URL.html',
'Template::Plugin::View' => 'Modules/Template/Plugin/View.html',
'Template::Plugin::Wrap' => 'Modules/Template/Plugin/Wrap.html',
- 'Template::Plugin::XML::DOM' => 'Modules/Template/Plugin/XML/DOM.html',
- 'Template::Plugin::XML::RSS' => 'Modules/Template/Plugin/XML/RSS.html',
- 'Template::Plugin::XML::Simple' => 'Modules/Template/Plugin/XML/Simple.html',
- 'Template::Plugin::XML::Style' => 'Modules/Template/Plugin/XML/Style.html',
- 'Template::Plugin::XML::XPath' => 'Modules/Template/Plugin/XML/XPath.html',
'Template::Modules' => 'Modules/index.html',
'Template::Library::HTML' => 'Library/HTML.html',
'Template::Library::Splash' => 'Library/Splash.html',
@@ -1436,13 +1128,10 @@ docset => {
cpan => {
'CGI' => 'CGI',
'Data::Dumper' => 'Data::Dumper',
- 'DBI' => 'DBI',
'Exporter' => 'Exporter',
- 'GD' => 'GD',
'Pod::POM' => 'Pod::POM',
'POSIX' => 'POSIX',
'Text::Autoformat' => 'Text::Autoformat',
- 'Tie::DBI' => 'Tie::DBI',
},
};
-%]
View
4 docs/src/FAQ/FAQ.html
@@ -332,8 +332,8 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-2.69, distributed as part of the
-Template Toolkit version 2.13, released on 30 January 2004.
+2.65, distributed as part of the
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
4 docs/src/Library/HTML.html
@@ -292,8 +292,8 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-2.69, distributed as part of the
-Template Toolkit version 2.13, released on 30 January 2004.
+2.65, distributed as part of the
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
4 docs/src/Library/PostScript.html
@@ -47,8 +47,8 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-2.69, distributed as part of the
-Template Toolkit version 2.13, released on 30 January 2004.
+2.65, distributed as part of the
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
4 docs/src/Library/Splash.html
@@ -892,8 +892,8 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-2.69, distributed as part of the
-Template Toolkit version 2.13, released on 30 January 2004.
+2.65, distributed as part of the
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
88 docs/src/Manual/Config.html
@@ -1088,44 +1088,44 @@
example 1 (file name):
</p>
<pre> my $template = Template-&gt;new({
- OUTPUT =&gt; &quot;/tmp/foo&quot;,
+ OUTPUT =&gt; &quot;/tmp/foo&quot;,
});</pre>
<p>
example 2 (text string):
</p>
<pre> my $output = '';</pre>
<pre> my $template = Template-&gt;new({
- OUTPUT =&gt; \$output,
+ OUTPUT =&gt; \$output,
});</pre>
<p>
example 3 (file handle):
</p>
<pre> open (TOUT, &quot;&gt; $file&quot;) || die &quot;$file: $!\n&quot;;</pre>
<pre> my $template = Template-&gt;new({
- OUTPUT =&gt; \*TOUT,
+ OUTPUT =&gt; \*TOUT,
});</pre>
<p>
example 4 (subroutine):
</p>
<pre> sub output { my $out = shift; print &quot;OUTPUT: $out&quot; }</pre>
<pre> my $template = Template-&gt;new({
- OUTPUT =&gt; \&amp;output,
+ OUTPUT =&gt; \&amp;output,
});</pre>
<p>
example 5 (array reference):
</p>
<pre> my $template = Template-&gt;new({
- OUTPUT =&gt; \@output,
+ OUTPUT =&gt; \@output,
})</pre>
<p>
example 6 (Apache/mod_perl handler):
</p>
<pre> sub handler {
- my $r = shift;</pre>
-<pre> my $t = Template-&gt;new({
- OUTPUT =&gt; $r,
- });
- ...
+ my $r = shift;</pre>
+<pre> my $t = Template-&gt;new({
+ OUTPUT =&gt; $r,
+ });
+ ...
}</pre>
<p>
The default OUTPUT location be overridden by passing a third parameter
@@ -1133,7 +1133,7 @@
above argument types.
</p>
<pre> $t-&gt;process($file, $vars, &quot;/tmp/foo&quot;);
- $t-&gt;process($file, $vars, &quot;bar&quot;);
+ $t-&gt;process($file, $vars, \$output);
$t-&gt;process($file, $vars, \*MYGLOB);
$t-&gt;process($file, $vars, \@output);
$t-&gt;process($file, $vars, $r); # Apache::Request
@@ -1432,12 +1432,25 @@
redefined by values in the PLUGINS hash.
</p>
<pre> my $template = Template-&gt;new({
- PLUGINS =&gt; {
- cgi =&gt; 'MyOrg::Template::Plugin::CGI',
- foo =&gt; 'MyOrg::Template::Plugin::Foo',
- bar =&gt; 'MyOrg::Template::Plugin::Bar',
- },
- });</pre>
+ PLUGINS =&gt; {
+ cgi =&gt; 'MyOrg::Template::Plugin::CGI',
+ foo =&gt; 'MyOrg::Template::Plugin::Foo',
+ bar =&gt; 'MyOrg::Template::Plugin::Bar',
+ },
+ }); </pre>
+<p>
+The recommended convention is to specify these plugin names in lower
+case. The Template Toolkit first looks for an exact case-sensitive
+match and then tries the lower case conversion of the name specified.
+</p>
+<pre> [% tt_start_tag %] USE Foo [% tt_end_tag %] # look for 'Foo' then 'foo'</pre>
+<p>
+If you define all your PLUGINS with lower case names then they will be
+located regardless of how the user specifies the name in the USE
+directive. If, on the other hand, you define your PLUGINS with upper
+or mixed case names then the name specified in the USE directive must
+match the case exactly.
+</p>
<p>
The USE directive is used to create plugin objects and does so by
calling the plugin() method on the current Template::Context object.
@@ -1448,8 +1461,8 @@
new() method can be called to instantiate individual plugin objects.
</p>
<p>
-If the plugin name is not defined in the PLUGINS hash then the PLUGIN_BASE
-and/or LOAD_PERL options come into effect.
+If the plugin name is not defined in the PLUGINS hash then the
+PLUGIN_BASE and/or LOAD_PERL options come into effect.
</p>
<li><b>PLUGIN_BASE</b><br>
@@ -1459,18 +1472,16 @@
loaded.
</p>
<p>
-The PLUGIN_BASE can be specified as a single value or as a reference
-to an array of multiple values. The default PLUGIN_BASE value,
-'Template::Plugin', is always added the the end of the PLUGIN_BASE
-list (a single value is first converted to a list). Each value should
-contain a Perl package name to which the requested plugin name is
-appended.
+The PLUGIN_BASE can be specified as a reference to an array of module
+namespaces, or as a single value which is automatically converted to a
+list. The default PLUGIN_BASE value ('Template::Plugin') is then added
+to the end of this list.
</p>
<p>
example 1:
</p>
<pre> my $template = Template-&gt;new({
- PLUGIN_BASE =&gt; 'MyOrg::Template::Plugin',
+ PLUGIN_BASE =&gt; 'MyOrg::Template::Plugin',
});</pre>
<pre> [% tt_start_tag %] USE Foo [% tt_end_tag %] # =&gt; MyOrg::Template::Plugin::Foo
or Template::Plugin::Foo </pre>
@@ -1478,12 +1489,31 @@
example 2:
</p>
<pre> my $template = Template-&gt;new({
- PLUGIN_BASE =&gt; [ 'MyOrg::Template::Plugin',
- 'YourOrg::Template::Plugin' ],
+ PLUGIN_BASE =&gt; [ 'MyOrg::Template::Plugin',
+ 'YourOrg::Template::Plugin' ],
});</pre>
<pre> [% tt_start_tag %] USE Foo [% tt_end_tag %] # =&gt; MyOrg::Template::Plugin::Foo
or YourOrg::Template::Plugin::Foo
or Template::Plugin::Foo </pre>
+<p>
+If you don't want the default Template::Plugin namespace added to the
+end of the PLUGIN_BASE, then set the $Template::Plugins::PLUGIN_BASE
+variable to a false value before calling the Template new()
+constructor method. This is shown in the example below where the
+'Foo' is located as 'My::Plugin::Foo' or 'Your::Plugin::Foo' but not
+as 'Template::Plugin::Foo'.
+</p>
+<p>
+example 3:
+</p>
+<pre> use Template::Plugins;
+ $Template::Plugins::PLUGIN_BASE = '';</pre>
+<pre> my $template = Template-&gt;new({
+ PLUGIN_BASE =&gt; [ 'My::Plugin',
+ 'Your::Plugin' ],
+ });</pre>
+<pre> [% tt_start_tag %] USE Foo [% tt_end_tag %] # =&gt; My::Plugin::Foo
+ or Your::Plugin::Foo </pre>
<li><b>LOAD_PERL</b><br>
<p>
@@ -1940,7 +1970,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
82 docs/src/Manual/Credits.html
@@ -93,67 +93,25 @@
the Template Toolkit. Their efforts continue to be very much appreciated.
Please let me know if you think anyone is missing from this list.
</p>
-<pre> Chuck Adams &lt;scrytch@uswest.net&gt;
- Stephen Adkins &lt;stephen.adkins@officevision.com&gt;
- Ivan Adzhubey &lt;iadzhubey@rics.bwh.harvard.edu&gt;
- Mark Anderson &lt;mda@discerning.com&gt;
- Bradley Baetz &lt;bbaetz@student.usyd.edu.au&gt;
- Thierry-Michel Barral &lt;kktos@electron-libre.com&gt;
- Craig Barratt &lt;craig@arraycomm.com&gt;
- Stas Bekman &lt;stas@stason.org&gt;
- Tony Bowden &lt;tony-tt@kasei.com&gt;
- Neil Bowers &lt;neilb@cre.canon.co.uk&gt;
- Leon Brocard &lt;acme@astray.com&gt;
- Lyle Brooks &lt;brooks@deseret.com&gt;
- Dave Cash &lt;dave@gnofn.org&gt;
- Piers Cawley &lt;pdcawley@bofh.org.uk&gt;
- Darren Chamberlain &lt;dlc@users.sourceforge.net&gt;
- Eric Cholet &lt;cholet@logilune.com&gt;
- Dave Cross &lt;dave@dave.org.uk&gt;
- Chris Dean &lt;ctdean@babycenter.com&gt;
- Francois Desarmenien &lt;desar@club-internet.fr&gt;
- Horst Dumcke &lt;hdumcke@cisco.com&gt;
- Mark Fowler &lt;mark@indicosoftware.com&gt;
- Michael Fowler &lt;michael@shoebox.net&gt;
- Axel Gerstmair &lt;anthill@web.de&gt;
- Dylan William Hardison &lt;dylanwh@tampabay.rr.com&gt;
- Perrin Harkins &lt;pharkins@etoys.com&gt;
- Bryce Harrington &lt;bryce@osdl.org&gt;
- Dave Hodgkinson &lt;daveh@davehodgkinson.com&gt;
- Harald Joerg &lt;Harald.Joerg@fujitsu-siemens.com&gt;
- Colin Johnson &lt;colin@knowledgepool.com&gt;
- Vivek Khera &lt;khera@kciLink.com&gt;
- Rafael Kitover &lt;caelum@debian.org&gt;
- Ivan Kurmanov &lt;http://www.ahinea.com&gt;
- Hans von Lengerke &lt;hans@lengerke.org&gt;
- Jonas Liljegren &lt;jonas@paranormal.se&gt;
- Simon Luff &lt;simon@sports.com&gt;
- Paul Makepeace &lt;Paul.Makepeace@realprogrammers.com&gt;
- Gervase Markham &lt;gerv@mozilla.org&gt;
- Simon Matthews &lt;sam@knowledgepool.com&gt;
- Robert McArthur &lt;mcarthur@dstc.edu.au&gt;
- Craig McLane &lt;mclanec@oxy.edu&gt;
- Leslie Michael Orchard &lt;deus_x@ninjacode.com&gt;
- Eugene Miretskiy &lt;eugene@invision.net&gt;
- Tatsuhiko Miyagawa &lt;miyagawa@edge.co.jp&gt;
- Keith G. Murphy &lt;keithmur@mindspring.com&gt;
- Chris Nandor &lt;pudge@pobox.com&gt;
- Briac Pilpré &lt;briac@pilpre.com&gt;
- Martin Portman &lt;mrp@cre.canon.co.uk&gt;
- Slaven Rezic &lt;slaven.rezic@berlin.de&gt;
- Christian Schaffner &lt;schaffner@eeh.ee.ethz.ch&gt;
- Randal L. Schwartz &lt;merlyn@stonehenge.com&gt;
- Paul Sharpe &lt;paul@miraclefish.com&gt;
- Ville Skyttä &lt;ville.skytta@iki.fi&gt;
- Doug Steinwand &lt;dsteinwand@etoys.com&gt;
- Michael Stevens &lt;michael@etla.org&gt;
- Drew Taylor &lt;dtaylor@vialogix.com&gt;
- Swen Thuemmler &lt;Swen.Thuemmler@paderlinx.de&gt;
- Richard Tietjen &lt;Richard_Tietjen@mcgraw-hill.com&gt;
- Stathy G. Touloumis &lt;stathy.touloumis@edventions.com&gt;
- Jim Vaughan &lt;jim@mrjim.com&gt;
- Simon Wilcox &lt;simonw@simonwilcox.co.uk&gt;
- Chris Winters &lt;cwinters@intes.net&gt;</pre>
+<p>
+Chuck Adams, Stephen Adkins, Ivan Adzhubey, Mark Anderson, Bradley
+Baetz, Thierry-Michel Barral, Craig Barratt, Stas Bekman, Tony Bowden,
+Neil Bowers, Leon Brocard, Lyle Brooks, Dave Cash, Piers Cawley,
+Darren Chamberlain, Eric Cholet, Tosh Cooey, Dave Cross, Chris Dean,
+Francois Desarmenien, Horst Dumcke, Mark Fowler, Michael Fowler, Kenny
+Gatdula, Axel Gerstmair, Dylan William Hardison, Perrin Harkins, Bryce
+Harrington, Dave Hodgkinson, Lubomir Host, Dave Howorth, Harald Joerg,
+Colin Johnson, Vivek Khera, Rafael Kitover, Ivan Kurmanov, Hans von
+Lengerke, Jonas Liljegren, Simon Luff, Andy Maas, Paul Makepeace,
+Gervase Markham, Simon Matthews, Robert McArthur, Craig McLane, Myk
+Melez, Eugene Miretskiy, Tatsuhiko Miyagawa, Bill Moseley, Keith
+G. Murphy, Chris Nandor, Leslie Michael Orchard, Paul Orrock, Steve
+Peters, Briac Pilpré, Yuri Pimenov, Martin Portman, Slaven Rezic, Josh
+Rosenbaum, Christian Schaffner, Mike Schilli, Randal L. Schwartz, Paul
+Sharpe, Ville Skyttä, Barrie Slaymaker, Doug Steinwand, Michael
+Stevens, Autrijus Tang, Drew Taylor, Swen Thuemmler, Richard Tietjen,
+Stathy G. Touloumis, Jim Vaughan, Simon Wilcox, Chris Winters
+</p>
[%- END %]
[% WRAPPER section
title="AUTHOR"
@@ -167,7 +125,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
82 docs/src/Manual/Directives.html
@@ -1046,23 +1046,65 @@
and information on writing plugins, consult [% ttlink('Template::Plugin') -%].
</p>
<p>
-The plugin name is case-sensitive and will be appended to the
-PLUGIN_BASE value (default: 'Template::Plugin') to construct a full
-module name. Any periods, '.', in the name will be converted to '::'.
+A number of standard plugins are included with the Template Toolkit
+(see below and [% ttlink('Template::Manual::Plugins') -%]). The names of these
+standard plugins are case insensitive.
+</p>
+<pre> [% tt_start_tag %] USE CGI [% tt_end_tag %] # =&gt; Template::Plugin::CGI
+ [% tt_start_tag %] USE Cgi [% tt_end_tag %] # =&gt; Template::Plugin::CGI
+ [% tt_start_tag %] USE cgi [% tt_end_tag %] # =&gt; Template::Plugin::CGI</pre>
+<p>
+You can also define further plugins using the PLUGINS option.
+</p>
+<pre> my $tt = Template-&gt;new({
+ PLUGINS =&gt; {
+ foo =&gt; 'My::Plugin::Foo',
+ bar =&gt; 'My::Plugin::Bar',
+ },
+ });</pre>
+<p>
+The recommended convention is to specify these plugin names in lower
+case. The Template Toolkit first looks for an exact case-sensitive
+match and then tries the lower case conversion of the name specified.
+</p>
+<pre> [% tt_start_tag %] USE Foo [% tt_end_tag %] # look for 'Foo' then 'foo'</pre>
+<p>
+If you define all your PLUGINS with lower case names then they will be
+located regardless of how the user specifies the name in the USE
+directive. If, on the other hand, you define your PLUGINS with upper
+or mixed case names then the name specified in the USE directive must
+match the case exactly.
+</p>
+<p>
+If the plugin isn't defined in either the standard plugins
+($Template::Plugins::STD_PLUGINS) or via the PLUGINS option, then
+the PLUGIN_BASE is searched.
+</p>
+<p>
+In this case the plugin name <i>is</i> case-sensitive. It is appended to
+each of the PLUGIN_BASE module namespaces in turn (default:
+'Template::Plugin') to construct a full module name which it attempts
+to locate and load. Any periods, '.', in the name will be converted
+to '::'.
</p>
<pre> [% tt_start_tag %] USE MyPlugin [% tt_end_tag %] # =&gt; Template::Plugin::MyPlugin
[% tt_start_tag %] USE Foo.Bar [% tt_end_tag %] # =&gt; Template::Plugin::Foo::Bar</pre>
<p>
-Various standard plugins are included with the Template Toolkit (see
-below and [% ttlink('Template::Manual::Plugins') -%]). These can be specified in lower
-case and are mapped to the appropriate name.
+The LOAD_PERL option (disabled by default) provides a further way by
+which external Perl modules may be loaded. If a regular Perl module
+(i.e. not a Template::Plugin::* or other module relative to some
+PLUGIN_BASE) supports an object-oriented interface and a new()
+constructor then it can be loaded and instantiated automatically. The
+following trivial example shows how the IO::File module might be used.
</p>
-<pre> [% tt_start_tag %] USE cgi [% tt_end_tag %] # =&gt; Template::Plugin::CGI
- [% tt_start_tag %] USE table [% tt_end_tag %] # =&gt; Template::Plugin::Table</pre>
+<pre> [% tt_start_tag %] USE file = IO.File('/tmp/mydata') [% tt_end_tag %]</pre>
+<pre> [% tt_start_tag %] WHILE (line = file.getline) [% tt_end_tag %]
+ &lt;!-- [% tt_start_tag %] line [% tt_end_tag %] --&gt;
+ [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
Any additional parameters supplied in parenthesis after the plugin
name will be also be passed to the new() constructor. A reference to
-the current Template::Context object is always passed as the first
+the current Template::Context object is passed as the first
parameter.
</p>
<pre> [% tt_start_tag %] USE MyPlugin('foo', 123) [% tt_end_tag %]</pre>
@@ -1071,6 +1113,14 @@
</p>
<pre> Template::Plugin::MyPlugin-&gt;new($context, 'foo', 123);</pre>
<p>
+The only exception to this is when a module is loaded via the
+LOAD_PERL option. In this case the $context reference is <i>not</i>
+passed to the new() constructor. This is based on the assumption that
+the module is a regular Perl module rather than a Template Toolkit
+plugin so isn't expecting a context reference and wouldn't know what
+to do with it anyway.
+</p>
+<p>
Named parameters may also be specified. These are collated into a
hash which is passed by reference as the last parameter to the
constructor, as per the general code calling interface.
@@ -1157,18 +1207,6 @@
See [% ttlink('Template::Manual::Plugins') -%] for more information on the plugins
distributed with the toolkit or available from CPAN.
</p>
-<p>
-The LOAD_PERL option (disabled by default) provides a further way by
-which external Perl modules may be loaded. If a regular Perl module
-(i.e. not a Template::Plugin::* or other module relative to some
-PLUGIN_BASE) supports an object-oriented interface and a new()
-constructor then it can be loaded and instantiated automatically. The
-following trivial example shows how the IO::File module might be used.
-</p>
-<pre> [% tt_start_tag %] USE file = IO.File('/tmp/mydata') [% tt_end_tag %]</pre>
-<pre> [% tt_start_tag %] WHILE (line = file.getline) [% tt_end_tag %]
- &lt;!-- [% tt_start_tag %] line [% tt_end_tag %] --&gt;
- [% tt_start_tag %] END [% tt_end_tag %]</pre>
<li><b>MACRO</b><br>
<p>
@@ -2007,7 +2045,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
91 docs/src/Manual/Filters.html
@@ -32,7 +32,7 @@
"html_line_break",
"uri",
"indent(pad)",
- "truncate(length)",
+ "truncate(length,dots)",
"repeat(iterations)",
"remove(string) ",
"replace(search, replace) ",
@@ -154,9 +154,9 @@
[% WRAPPER subsection
title = "html"
-%]<p>
-Converts the characters '&lt;', '&gt;' and '&amp;' to '&amp;lt;', '&amp;gt;' and
-'&amp;amp;', respectively, protecting them from being interpreted as
-representing HTML tags or entities.
+Converts the characters '&lt;', '&gt;', '&amp;' and '&quot;' to '&amp;lt;',
+'&amp;gt;', '&amp;amp;', and '&amp;quot;' respectively, protecting them from being
+interpreted as representing HTML tags or entities.
</p>
<pre> [% tt_start_tag %] FILTER html [% tt_end_tag %]
Binary &quot;&lt;=&gt;&quot; returns -1, 0, or 1 depending on...
@@ -280,11 +280,11 @@
ME&gt; cabbages, rhubard, onions</pre>
[%- END %]
[% WRAPPER subsection
- title = "truncate(length)"
+ title = "truncate(length,dots)"
-%]<p>
-Truncates the text block to the length specified, or a default length of
-32. Truncated text will be terminated with '...' (i.e. the '...' falls
-inside the required length, rather than appending to it).
+Truncates the text block to the length specified, or a default length
+of 32. Truncated text will be terminated with '...' (i.e. the '...'
+falls inside the required length, rather than appending to it).
</p>
<pre> [% tt_start_tag %] FILTER truncate(21) [% tt_end_tag %]
I have much to say on this matter that has previously
@@ -294,6 +294,18 @@
output:
</p>
<pre> I have much to say...</pre>
+<p>
+If you want to use something other than '...' you can pass that as a
+second argument.
+</p>
+<pre> [% tt_start_tag %] FILTER truncate(26, '&amp;hellip;') [% tt_end_tag %]
+ I have much to say on this matter that has previously
+ been said on more than one occasion.
+ [% tt_start_tag %] END [% tt_end_tag %]</pre>
+<p>
+output:
+</p>
+<pre> I have much to say&amp;hellip;</pre>
[%- END %]
[% WRAPPER subsection
title = "repeat(iterations)"
@@ -480,64 +492,9 @@
[% WRAPPER subsection
title = "latex(outputType)"
-%]<p>
-Passes the text block to LaTeX and produces either PDF, DVI or
-PostScript output. The 'outputType' argument determines the output
-format and it should be set to one of the strings: &quot;pdf&quot; (default),
-&quot;dvi&quot;, or &quot;ps&quot;.
-</p>
-<p>
-The text block should be a complete LaTeX source file.
-</p>
-<pre> [% tt_start_tag %] FILTER latex(&quot;pdf&quot;) -[% tt_end_tag %]
- \documentclass{article}</pre>
-<pre> \begin{document}</pre>
-<pre> \title{A Sample TT2 \LaTeX\ Source File}
- \author{Craig Barratt}
- \maketitle</pre>
-<pre> \section{Introduction}
- This is some text.</pre>
-<pre> \end{document}
- [% tt_start_tag %] END -[% tt_end_tag %]</pre>
-<p>
-The output will be a PDF file. You should be careful not to prepend or
-append any extraneous characters or text outside the FILTER block,
-since this text will wrap the (binary) output of the latex filter.
-Notice the END directive uses '-[% tt_end_tag %]' for the END_TAG to remove the
-trailing new line.
-</p>
-<p>
-One example where you might prepend text is in a CGI script where
-you might include the Content-Type before the latex output, eg:
-</p>
-<pre> Content-Type: application/pdf</pre>
-<pre> [% tt_start_tag %] FILTER latex(&quot;pdf&quot;) -[% tt_end_tag %]
- \documentclass{article}
- \begin{document}
- ...
- \end{document}
- [% tt_start_tag %] END -[% tt_end_tag %]</pre>
-<p>
-In other cases you might use the redirect filter to put the output
-into a file, rather than delivering it to stdout. This might be
-suitable for batch scripts:
-</p>
-<pre> [% tt_start_tag %] output = FILTER latex(&quot;pdf&quot;) -[% tt_end_tag %]
- \documentclass{article}
- \begin{document}
- ...
- \end{document}
- [% tt_start_tag %] END; output | redirect(&quot;document.pdf&quot;, 1) -[% tt_end_tag %]</pre>
-<p>
-(Notice the second argument to redirect to force binary mode.)
-</p>
-<p>
-Note that the latex filter runs one or two external programs, so it
-isn't very fast. But for modest documents the performance is adequate,
-even for interactive applications.
-</p>
-<p>
-A error of type 'latex' will be thrown if there is an error reported
-by latex, pdflatex or dvips.
+The latex() filter is no longer part of the core Template Toolkit
+distribution as of version 2.15. You can download it as a
+separate Template-Latex distribution from CPAN.
</p>
[%- END %]
[%- END %]
@@ -553,7 +510,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
2  docs/src/Manual/Internals.html
@@ -544,7 +544,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
2  docs/src/Manual/Intro.html
@@ -267,7 +267,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
223 docs/src/Manual/Plugins.html
@@ -28,11 +28,7 @@
"File",
"Filter",
"Format",
- "GD::Image, GD::Polygon, GD::Constants",
- "GD::Text, GD::Text::Align, GD::Text::Wrap",
- "GD::Graph::lines, GD::Graph::bars, GD::Graph::points, GD::Graph::linespoin
-ts, GD::Graph::area, GD::Graph::mixed, GD::Graph::pie",
- "GD::Graph::bars3d, GD::Graph::lines3d, GD::Graph::pie3d",
+ "GD",
"HTML",
"Iterator",
"Pod",
@@ -40,11 +36,8 @@
"Table",
"URL",
"Wrap",
- "XML::DOM",
- "XML::RSS",
- "XML::Simple",
"XML::Style",
- "XML::XPath"
+ "XML"
];
PROCESS tocitem
title ="AUTHOR"
@@ -113,7 +106,7 @@
Provides an interface to data stored in a plain text file in a simple
delimited format. The first line in the file specifies field names
which should be delimiter by any non-word character sequence.
-Subsequent lines define data using the same delimiter as int he first
+Subsequent lines define data using the same delimiter as in the first
line. Blank lines and comments (lines starting '#') are ignored. See
[% ttlink('Template::Plugin::Datafile') -%] for further details.
</p>
@@ -162,19 +155,10 @@
[% WRAPPER subsection
title = "DBI"
-%]<p>
-The DBI plugin, developed by Simon Matthews
-&lt;sam@knowledgepool.com&gt;, brings the full power of Tim Bunce's
-&lt;Tim.Bunce@ig.co.uk&gt; database interface module (DBI) to your
-templates. See [% ttlink('Template::Plugin::DBI') -%] and [% ttlink('DBI') -%] for further details.
-</p>
-<pre> [% tt_start_tag %] USE DBI('dbi:driver:database', 'user', 'pass') [% tt_end_tag %]</pre>
-<pre> [% tt_start_tag %] FOREACH user = DBI.query( 'SELECT * FROM users' ) [% tt_end_tag %]
- [% tt_start_tag %] user.id [% tt_end_tag %] [% tt_start_tag %] user.name [% tt_end_tag %]
- [% tt_start_tag %] END [% tt_end_tag %]</pre>
-<p>
-The DBI and relevant DBD modules are available from CPAN:
+The DBI plugin is no longer distributed as part of the Template Toolkit
+(as of version 2.15). It is now available as a separate Template-Plugin-DBI
+distribution from CPAN.
</p>
-<pre> http://www.cpan.org/modules/by-module/DBI/</pre>
[%- END %]
[% WRAPPER subsection
title = "Dumper"
@@ -232,137 +216,16 @@
[% tt_start_tag %] bold('Hello') [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
- title = "GD::Image, GD::Polygon, GD::Constants"
--%]<p>
-These plugins provide access to the GD graphics library via Lincoln
-D. Stein's GD.pm interface. These plugins allow PNG, JPEG and other
-graphical formats to be generated.
-</p>
-<pre> [% tt_start_tag %] FILTER null;
- USE im = GD.Image(100,100);
- # allocate some colors
- black = im.colorAllocate(0, 0, 0);
- red = im.colorAllocate(255,0, 0);
- blue = im.colorAllocate(0, 0, 255);
- # Draw a blue oval
- im.arc(50,50,95,75,0,360,blue);
- # And fill it with red
- im.fill(50,50,red);
- # Output image in PNG format
- im.png | stdout(1);
- END;
- -[% tt_end_tag %]</pre>
-<p>
-See [% ttlink('Template::Plugin::GD::Image') -%] for further details.
-</p>
-[%- END %]
-[% WRAPPER subsection
- title = "GD::Text, GD::Text::Align, GD::Text::Wrap"
+ title = "GD"
-%]<p>
-These plugins provide access to Martien Verbruggen's GD::Text,
-GD::Text::Align and GD::Text::Wrap modules. These plugins allow the
-layout, alignment and wrapping of text when drawing text in GD images.
-</p>
-<pre> [% tt_start_tag %] FILTER null;
- USE gd = GD.Image(200,400);
- USE gdc = GD.Constants;
- black = gd.colorAllocate(0, 0, 0);
- green = gd.colorAllocate(0, 255, 0);
- txt = &quot;This is some long text. &quot; | repeat(10);
- USE wrapbox = GD.Text.Wrap(gd,
- line_space =&gt; 4,
- color =&gt; green,
- text =&gt; txt,
- );
- wrapbox.set_font(gdc.gdMediumBoldFont);
- wrapbox.set(align =&gt; 'center', width =&gt; 160);
- wrapbox.draw(20, 20);
- gd.png | stdout(1);
- END;
- -[% tt_end_tag %]</pre>
-<p>
-See [% ttlink('Template::Plugin::GD::Text') -%], [% ttlink('Template::Plugin::GD::Text::Align') -%]
-and [% ttlink('Template::Plugin::GD::Text::Wrap') -%] for further details.
-</p>
-[%- END %]
-[% WRAPPER subsection
- title = "GD::Graph::lines, GD::Graph::bars, GD::Graph::points, GD::Graph::linespoin
-ts, GD::Graph::area, GD::Graph::mixed, GD::Graph::pie"
--%]<p>
-These plugins provide access to Martien Verbruggen's GD::Graph module
-that allows graphs, plots and charts to be created. These plugins allow
-graphs, plots and charts to be generated in PNG, JPEG and other
-graphical formats.
-</p>
-<pre> [% tt_start_tag %] FILTER null;
- data = [
- [&quot;1st&quot;,&quot;2nd&quot;,&quot;3rd&quot;,&quot;4th&quot;,&quot;5th&quot;,&quot;6th&quot;],
- [ 4, 2, 3, 4, 3, 3.5]
- ];
- USE my_graph = GD.Graph.pie(250, 200);
- my_graph.set(
- title =&gt; 'A Pie Chart',
- label =&gt; 'Label',
- axislabelclr =&gt; 'black',
- pie_height =&gt; 36,
- transparent =&gt; 0,
- );
- my_graph.plot(data).png | stdout(1);
- END;
- -[% tt_end_tag %]</pre>
-<p>
-See
-[% ttlink('Template::Plugin::GD::Graph::lines') -%],
-[% ttlink('Template::Plugin::GD::Graph::bars') -%],
-[% ttlink('Template::Plugin::GD::Graph::points') -%],
-[% ttlink('Template::Plugin::GD::Graph::linespoints') -%],
-[% ttlink('Template::Plugin::GD::Graph::area') -%],
-[% ttlink('Template::Plugin::GD::Graph::mixed') -%],
-[% ttlink('Template::Plugin::GD::Graph::pie') -%], and
-[% ttlink('GD::Graph') -%],
-for more details.
-</p>
-[%- END %]
-[% WRAPPER subsection
- title = "GD::Graph::bars3d, GD::Graph::lines3d, GD::Graph::pie3d"
--%]<p>
-These plugins provide access to Jeremy Wadsack's GD::Graph3d
-module. This allows 3D bar charts and 3D lines plots to
-be generated.
-</p>
-<pre> [% tt_start_tag %] FILTER null;
- data = [
- [&quot;1st&quot;,&quot;2nd&quot;,&quot;3rd&quot;,&quot;4th&quot;,&quot;5th&quot;,&quot;6th&quot;,&quot;7th&quot;, &quot;8th&quot;, &quot;9th&quot;],
- [ 1, 2, 5, 6, 3, 1.5, 1, 3, 4],
- ];
- USE my_graph = GD.Graph.bars3d();
- my_graph.set(
- x_label =&gt; 'X Label',
- y_label =&gt; 'Y label',
- title =&gt; 'A 3d Bar Chart',
- y_max_value =&gt; 8,
- y_tick_number =&gt; 8,
- y_label_skip =&gt; 2,
- # shadows
- bar_spacing =&gt; 8,
- shadow_depth =&gt; 4,
- shadowclr =&gt; 'dred',
- transparent =&gt; 0,
- my_graph.plot(data).png | stdout(1);
- END;
- -[% tt_end_tag %]</pre>
-<p>
-See
-[% ttlink('Template::Plugin::GD::Graph::lines3d') -%],
-[% ttlink('Template::Plugin::GD::Graph::bars3d') -%], and
-[% ttlink('Template::Plugin::GD::Graph::pie3d') -%]
-for more details.
+The GD plugins are no longer part of the core Template Toolkit distribution.
+They are now available in a separate Template-GD distribution.
</p>
[%- END %]
[% WRAPPER subsection
title = "HTML"
-%]<p>
-The HTML plugin is very new and very basic, implementing a few useful
+The HTML plugin is very basic, implementing a few useful
methods for generating HTML. It is likely to be extended in the future
or integrated with a larger project to generate HTML elements in a generic
way (as discussed recently on the mod_perl mailing list).
@@ -463,56 +326,6 @@
<pre> http://www.cpan.org/modules/by-module/Text/</pre>
[%- END %]
[% WRAPPER subsection
- title = "XML::DOM"
--%]<p>
-The XML::DOM plugin gives access to the XML Document Object Module via
-Clark Cooper &lt;cooper@sch.ge.com&gt; and Enno Derksen's
-&lt;enno@att.com&gt; XML::DOM module. See [% ttlink('Template::Plugin::XML::DOM') -%]
-and [% ttlink('XML::DOM') -%] for further details.
-</p>
-<pre> [% tt_start_tag %] USE dom = XML.DOM [% tt_end_tag %]
- [% tt_start_tag %] doc = dom.parse(filename) [% tt_end_tag %]</pre>
-<pre> [% tt_start_tag %] FOREACH node = doc.getElementsByTagName('CODEBASE') [% tt_end_tag %]
- * [% tt_start_tag %] node.getAttribute('href') [% tt_end_tag %]
- [% tt_start_tag %] END [% tt_end_tag %]</pre>
-<p>
-The plugin requires the XML::DOM module, available from CPAN:
-</p>
-<pre> http://www.cpan.org/modules/by-module/XML/</pre>
-[%- END %]
-[% WRAPPER subsection
- title = "XML::RSS"
--%]<p>
-The XML::RSS plugin is a simple interface to Jonathan Eisenzopf's
-&lt;eisen@pobox.com&gt; XML::RSS module. A RSS (Rich Site Summary)
-file is typically used to store short news 'headlines' describing
-different links within a site. This plugin allows you to parse RSS
-files and format the contents accordingly using templates.
-See [% ttlink('Template::Plugin::XML::RSS') -%] and [% ttlink('XML::RSS') -%] for further details.
-</p>
-<pre> [% tt_start_tag %] USE news = XML.RSS(filename) [% tt_end_tag %]
-
- [% tt_start_tag %] FOREACH item = news.items [% tt_end_tag %]
- &lt;a href=&quot;[% tt_start_tag %] item.link [% tt_end_tag %]&quot;&gt;[% tt_start_tag %] item.title [% tt_end_tag %]&lt;/a&gt;
- [% tt_start_tag %] END [% tt_end_tag %]</pre>
-<p>
-The XML::RSS module is available from CPAN:
-</p>
-<pre> http://www.cpan.org/modules/by-module/XML/</pre>
-[%- END %]
-[% WRAPPER subsection
- title = "XML::Simple"
--%]<p>
-This plugin implements an interface to the [% ttlink('XML::Simple', 'XML::Simple') -%]
-module.
-</p>
-<pre> [% tt_start_tag %] USE xml = XML.Simple(xml_file_or_text) [% tt_end_tag %]</pre>
-<pre> [% tt_start_tag %] xml.head.title [% tt_end_tag %]</pre>
-<p>
-See [% ttlink('Template::Plugin::XML::Simple') -%] for further details.
-</p>
-[%- END %]
-[% WRAPPER subsection
title = "XML::Style"
-%]<p>
This plugin defines a filter for performing simple stylesheet based
@@ -539,20 +352,14 @@
</p>
[%- END %]
[% WRAPPER subsection
- title = "XML::XPath"
+ title = "XML"
-%]<p>
-The XML::XPath plugin provides an interface to Matt Sergeant's
-&lt;matt@sergeant.org&gt; XML::XPath module. See
-[% ttlink('Template::Plugin::XML::XPath') -%] and [% ttlink('XML::XPath') -%] for further details.
+The XML::DOM, XML::RSS, XML::Simple and XML::XPath plugins are no
+longer distributed with the Template Toolkit as of version 2.15
</p>
-<pre> [% tt_start_tag %] USE xpath = XML.XPath(xmlfile) [% tt_end_tag %]
- [% tt_start_tag %] FOREACH page = xpath.findnodes('/html/body/page') [% tt_end_tag %]
- [% tt_start_tag %] page.getAttribute('title') [% tt_end_tag %]
- [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
-The plugin requires the XML::XPath module, available from CPAN:
+They are now available in a separate Template-XML distribution.
</p>
-<pre> http://www.cpan.org/modules/by-module/XML/</pre>
[%- END %]
[%- END %]
[% WRAPPER section
@@ -567,7 +374,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
2  docs/src/Manual/Refs.html
@@ -143,7 +143,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
2  docs/src/Manual/Syntax.html
@@ -285,7 +285,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
61 docs/src/Manual/VMethods.html
@@ -73,6 +73,14 @@
<pre> [% tt_start_tag %] name = 'foo, bar &amp; baz' [% tt_end_tag %]
[% tt_start_tag %] name.replace('\W+', '_') [% tt_end_tag %] # foo_bar_baz</pre>
+<li><b>remove(pattern)</b><br>
+<p>
+Outputs the string with all instances of the pattern (specified
+as a Perl regular expression) removed.
+</p>
+<pre> [% tt_start_tag %] name = 'foo, bar &amp; baz' [% tt_end_tag %]
+ [% tt_start_tag %] name.remove('\W+') [% tt_end_tag %] # foobarbaz</pre>
+
<li><b>match(pattern)</b><br>
<p>
Performs a regular expression match on the string using the pattern
@@ -232,6 +240,16 @@
</p>
<pre> [% tt_start_tag %] hash.defined('somekey') ? 'yes' : 'no' [% tt_end_tag %]
[% tt_start_tag %] hash.exists('somekey') ? 'yes' : 'no' [% tt_end_tag %]</pre>
+<p>
+When called without any argument, hash.defined returns true if the hash
+itself is defined (e.g. the same effect as scalar.defined).
+</p>
+
+<li><b>delete </b><br>
+<p>
+Delete one or more items from the hash.
+</p>
+<pre> [% tt_start_tag %] hash.delete('foo', 'bar') [% tt_end_tag %]</pre>
<li><b>size</b><br>
<p>
@@ -250,10 +268,20 @@
passed to indicate the desired items required in the list: 'keys' to
return a list of the keys (same as hash.keys), 'values' to return a
list of the values (same as hash.values), or 'each' to return as list
-of (key, value) pairs (same as hash.each). When called without an
-argument it returns a list of hash references, each of which contains
-a 'key' and 'value' item representing a single key =&gt; value pair
-in the hash.
+of (key, value) pairs (same as hash.each).
+</p>
+<p>
+When called without an argument it returns a reference to a list containing
+the contents of the hash.
+</p>
+<pre> [% tt_start_tag %] hash = { pi =&gt; 3.14 } [% tt_end_tag %]
+ [% tt_start_tag %] hash.list.join [% tt_end_tag %] # pi 3.14</pre>
+<p>
+Please note that this is a new behaviour for version 2.15. Prior to
+this the method returned an insanely complex data structure comprised of
+a reference to a list containing references to hash arrays containing
+'key' and 'value' items representing each corresponding key/value pair
+in the hash. You can see why we changed it.
</p>
</ul>
@@ -280,6 +308,17 @@
</p>
<pre> [% tt_start_tag %] results.size [% tt_end_tag %] search results matched your query</pre>
+<li><b>defined</b><br>
+<p>
+Returns a true or false value if the item in the list denoted by the
+argument is defined.
+</p>
+<pre> [% tt_start_tag %] list.defined(3) ? 'yes' : 'no' [% tt_end_tag %]</pre>
+<p>
+When called without any argument, list.defined returns true if the list
+itself is defined (e.g. the same effect as scalar.defined).
+</p>
+
<li><b>reverse</b><br>
<p>
Returns the items of the list in reverse order.
@@ -412,6 +451,16 @@
CALL list.splice(-1, 0, [ another_list ]);
[% tt_end_tag %]</pre>
+<li><b>hash </b><br>
+<p>
+Returns a reference to a hash array comprised of the elements
+in the list.
+</p>
+<pre> [% tt_start_tag %] list = ['pi', 3.14, 'e', 2.718] [% tt_end_tag %]
+ [% tt_start_tag %] hash = list.hash [% tt_end_tag %]
+ [% tt_start_tag %] hash.pi [% tt_end_tag %] # 3.14
+ [% tt_start_tag %] hash.e [% tt_end_tag %] # 2.718</pre>
+
</ul>
[%- END %]
[% WRAPPER subsection
@@ -450,7 +499,7 @@
like this, where we assume that 'something' is bound to a subroutine
which might return 1 or more items:
</p>
-<pre> [% tt_start_tag %] FOREACH item = something [% tt_end_tag %]
+<pre> [% tt_start_tag %] FOREACH item IN something [% tt_end_tag %]
...
[% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
@@ -504,7 +553,7 @@
[% WRAPPER section
title="VERSION"
-%]<p>
-Template Toolkit version 2.13, released on 30 January 2004.
+Template Toolkit version 2.15, released on 30 January 2006.
</p>
[%- END %]
[% WRAPPER section
View
236 docs/src/Manual/Variables.html
@@ -58,13 +58,13 @@
variables for all templates processed by the object.
</p>
<pre> my $tt = Template-&gt;new({
- VARIABLES =&gt; {
- version =&gt; 3.14,
- release =&gt; 'Sahara',
- },
+ VARIABLES =&gt; {
+ version =&gt; 3.14,
+ release =&gt; 'Sahara',
+ },
});</pre>
<pre> my $vars = {
- serial_no =&gt; 271828,
+ serial_no =&gt; 271828,
};</pre>
<pre> $tt-&gt;process('myfile', $vars);</pre>
<p>
@@ -101,15 +101,15 @@
Example:
</p>
<pre> my $vars = {
- article =&gt; 'The Third Shoe',
- person =&gt; {
- id =&gt; 314,
- name =&gt; 'Mr. Blue',
- email =&gt; 'blue@nowhere.org',
- },
- primes =&gt; [ 2, 3, 5, 7, 11, 13 ],
- wizard =&gt; sub { return join(' ', 'Abracadabra!', @_) },
- cgi =&gt; CGI-&gt;new('mode=submit&amp;debug=1'),
+ article =&gt; 'The Third Shoe',
+ person =&gt; {
+ id =&gt; 314,
+ name =&gt; 'Mr. Blue',
+ email =&gt; 'blue@nowhere.org',
+ },
+ primes =&gt; [ 2, 3, 5, 7, 11, 13 ],
+ wizard =&gt; sub { return join(' ', 'Abracadabra!', @_) },
+ cgi =&gt; CGI-&gt;new('mode=submit&amp;debug=1'),
};</pre>
<p>
template:
@@ -150,12 +150,12 @@
and key separated by the dot '.' operator.
</p>
<pre> my $vars = {
- 'home' =&gt; 'http://www.myserver.com/homepage.html',
- 'page' =&gt; {
- 'this' =&gt; 'mypage.html',
- 'next' =&gt; 'nextpage.html',
- 'prev' =&gt; 'prevpage.html',
- },
+ 'home' =&gt; 'http://www.myserver.com/homepage.html',
+ 'page' =&gt; {
+ 'this' =&gt; 'mypage.html',
+ 'next' =&gt; 'nextpage.html',
+ 'prev' =&gt; 'prevpage.html',
+ },
};</pre>
<p>
template:
@@ -177,18 +177,18 @@
DEBUG option is enabled).
</p>
<pre> my $vars = {
- message =&gt; 'Hello World!',
- _secret =&gt; &quot;On the Internet, no-one knows you're a dog&quot;,
- thing =&gt; {
- public =&gt; 123,
- _private =&gt; 456,
- '.hidden' =&gt; 789,
- },
+ message =&gt; 'Hello World!',
+ _secret =&gt; &quot;On the Internet, no-one knows you're a dog&quot;,
+ thing =&gt; {
+ public =&gt; 123,
+ _private =&gt; 456,
+ '.hidden' =&gt; 789,
+ },
};</pre>
<p>
template:
</p>
-<pre> [% tt_start_tag %] message [% tt_end_tag %] # outputs &quot;Hello World!&quot;
+<pre> [% tt_start_tag %] message [% tt_end_tag %] # outputs &quot;Hello World!&quot;
[% tt_start_tag %] _secret [% tt_end_tag %] # no output