Permalink
Browse files

*** empty log message ***

git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@42 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information...
1 parent ad5bfd4 commit 0b63aaec8f5587e444b8c20ebee260d57cd125b2 @abw committed Sep 8, 2000
Showing with 4,382 additions and 3,654 deletions.
  1. +95 −5 Changes
  2. +21 −113 MANIFEST
  3. +3 −5 MANIFEST.SKIP
  4. +9 −9 Makefile.PL
  5. +10 −34 TODO
  6. +1 −2 lib/Template/Context.pm
  7. +41 −2 lib/Template/Directive.pm
  8. +5 −5 lib/Template/Filters.pm
  9. +3,450 −3,360 lib/Template/Grammar.pm
  10. +6 −6 lib/Template/Parser.pm
  11. +0 −15 lib/Template/Plugins.pm
  12. +20 −8 lib/Template/Provider.pm
  13. +0 −43 lib/Template/README
  14. +8 −3 lib/Template/Service.pm
  15. +74 −18 lib/Template/Stash.pm
  16. +1 −0 parser/Parser.yp
  17. +4 −0 t/binop.t
  18. +15 −0 t/capture.t
  19. +26 −4 t/case.t
  20. +11 −0 t/compile4.t
  21. +4 −0 t/date.t
  22. +23 −3 t/evalperl.t
  23. +53 −6 t/filter.t
  24. +8 −0 t/list.t
  25. +9 −4 t/parser.t
  26. +92 −0 t/process.t
  27. +89 −0 t/ref.t
  28. +3 −2 t/skel.t
  29. +43 −0 t/stash.t
  30. +17 −3 t/tags.t
  31. +19 −4 t/vars.t
  32. +222 −0 t/vmeth.t
View
100 Changes
@@ -3,7 +3,11 @@
# Changes
#
# DESCRIPTION
-# Revision history for Template Toolkit.
+# Revision history for the Template Toolkit version 2.00, detailing
+# significant changes between versions, most recent first. Some
+# way down the file you'll find a section detailing major changes from
+# version 1.* to 2.* and a list of "Gotchas!" that you might have to
+# look out for when upgrading between major versions.
#
# AUTHOR
# Andy Wardley <abw@kfs.org>
@@ -16,12 +20,79 @@
# Version 2.00 beta 4
#------------------------------------------------------------------------
+* Added the PROCESS option which allows a template or templates to be
+ specified which is/are processed instead of the template passed as
+ an argument to the Template process() method. The original template
+ is available as the 'template' variable and can be processed by
+ calling INCLUDE or PROCESS as [% INCLUDE $template %].
+
+* Added the reference operator, '\' which allows a "reference" to
+ another variable to be taken. The implementation creates a closure
+ around the referenced variable which, when called, will return the
+ actual variable value. It is really a form of lazy evaluation, rather
+ than genuine reference taking, but it looks and smells almost the same.
+ Primarily, it is useful for allowing sub-routine references to be
+ passed to another sub-routine. See t/refs.t for examples until
+ documentation arrives.
+
+* Changed what was the CASE option to now be enabled by default and
+ then changed the name of the option to ANYCASE to make it more
+ obvious as to what it did. You must now specify directive keywords
+ (INCLUDE, FOREACH, IF, etc) in UPPER CASE only, or enable the
+ ANYCASE option to revert to the previous behaviour of recognising
+ keywords in any case. With the increase in reserved words in
+ version 2, there is more chance of collision with variable names.
+ It's a real pain not being able to have a variable called 'next', an
+ exception called 'perl', etc., because there's a reserved word of
+ the same name. Thus, keywords are now UPPER CASE only by default,
+ neatly side-stepping the problem.
+
+* Changed the PERL directive so that output is generated by calling
+ print() instead of using the final value in the block. Implemented
+ by tying STDOUT to an output buffer based on a patch sent in by
+ Chuck Adams.
+
+ new: old:
+ [% PERL %] [% PERL %]
+ print "foo\n"; my $output = "foo\n";
+ ... ...
+ print "bar\n"; $output .= "bar\n";
+ [% END %] $output;
+ [% END %]
+
+* The IMPORT directive and magical IMPORT variable have been removed
+ and replaced with a general purpose virtual hash method, import().
+
+ [% hash1.import(hash2) %] # was "hash1.IMPORT = hash2"
+ [% import(hash1) %] # was "IMPORT hash1" or "IMPORT = hash1"
+
+* Modified the Template::Filters provider to examine the FILTERS
+ package hash reference (changed name from STD_FILTERS) each time a
+ filter is requested rather than copying them at construction time.
+ This allows new filters to be added on-the-fly. See t/filter.t for
+ examples and Template::Filters for more info.
+
+* Added the 'nsort' list method which sorts items using a numerical
+ value sort rather than an alpha sort.
+
+ [% data = [ 1, 5, 10, 11 ] %]
+ [% data.sort.join(', ') %] # 1, 10, 11, 5
+ [% data.nsort.join(', ') %] # 1, 5, 10, 11
+
+* Fixed a bug in the persistant caching mechanism in Template::Provider
+ which was failing to write compiled template files for source templates
+ specifed in the form [% INCLUDE foo/bar %]. Intermediate directories
+ (like 'foo' in this example) weren't being created and the disk write
+ was failing. Thanks to Simon Matthews for identifying this problem.
+
* Fixed an obscure bug in the Template::Stash which was ignoring the
last element in a compound variable when followed by an empty
argument list. e.g. [% cgi.param() %] would be treated as [% cgi %].
- Thanks to Jonas Liljegren for reporting the problem.
+ Also fixed the DEBUG option so that undefined variables cause 'undef'
+ exceptions to be raised. Thanks to Jonas Liljegren for reporting the
+ problems.
-* Changes parser to automatically unescape any escaped characters in
+* Changed parser to automatically unescape any escaped characters in
double quoted strings except for \n and \$. This permits strings to
be constructed that include tag characters. e.g.
@@ -31,7 +102,10 @@
prevent newlines in test output from being automatically mangled to
literal '\n'.
-* Fixed various documentation problems, e.g. OUTPUT_PATH
+* Completed and corrected all knows bugs in the documentation which now
+ weighs in at around 100 pages for the Template.pm module alone.
+ The POD documentation should now be installed by default.
+
#------------------------------------------------------------------------
# Version 2.00 beta 3 10th August 2000
@@ -920,6 +994,22 @@ out.
* $Template::Directive::While::MAXITER is now
$Template::Directive::WHILE_MAX and may change again.
-* into() filter is obsolete, replaced by ***TODO***
+* into() filter is now obsolete. You can now simply assign the output of
+ another directive or block to a variable.
+
+ [% x = INCLUDE foo %]
+ [% y = BLOCK %]
+ blah blah blah
+ [% END %]
+
+* The CASE option has been removed and replaced with the ANYCASE option
+ which is the logical opposite. Directive keywords should now be UPPER
+ CASE by default and the ANYCASE option can be enabled to revert to
+ the previous behaviour of accept keywords in any case.
+* The IMPORT directive and magical variable have been removed and
+ replaced by a general purpose virtual hash method, import().
+ [% IMPORT myhash %] should now be written [% import(myhash) %]
+ and [% myhash.IMPORT = another.hash %] should be written as
+ [% myhash.import(another.hash) %]
View
134 MANIFEST
@@ -6,132 +6,30 @@ TODO
bin/README
bin/tpage
bin/ttree
-#clib/MANIFEST
-#clib/Makefile.PL
-#clib/README
-#clib/Stash.xs
-docs/lib/acks
-docs/lib/author
-docs/lib/contents
-docs/lib/copyright
-docs/lib/dir/block
-docs/lib/dir/break
-docs/lib/dir/call
-docs/lib/dir/clear
-docs/lib/dir/default
-docs/lib/dir/filter
-docs/lib/dir/for
-docs/lib/dir/get
-docs/lib/dir/if
-docs/lib/dir/include
-docs/lib/dir/insert
-docs/lib/dir/macro
-docs/lib/dir/perl
-docs/lib/dir/process
-docs/lib/dir/rawperl
-docs/lib/dir/return
-docs/lib/dir/set
-docs/lib/dir/stop
-docs/lib/dir/switch
-docs/lib/dir/try
-docs/lib/dir/use
-docs/lib/dir/while
-docs/lib/dir/wrapper
-docs/lib/exceptions
-docs/lib/filters
-docs/lib/footer
-docs/lib/option/absolute
-docs/lib/option/blocks
-docs/lib/option/cache
-docs/lib/option/case
-docs/lib/option/chomp
-docs/lib/option/compile
-docs/lib/option/context
-docs/lib/option/default
-docs/lib/option/delim
-docs/lib/option/error
-docs/lib/option/evalperl
-docs/lib/option/filters
-docs/lib/option/grammar
-docs/lib/option/include
-docs/lib/option/interp
-docs/lib/option/loadfilt
-docs/lib/option/loadperl
-docs/lib/option/loadplug
-docs/lib/option/loadtmpl
-docs/lib/option/outpath
-docs/lib/option/output
-docs/lib/option/parser
-docs/lib/option/plugbase
-docs/lib/option/plugins
-docs/lib/option/preproc
-docs/lib/option/relative
-docs/lib/option/reset
-docs/lib/option/service
-docs/lib/option/stash
-docs/lib/option/tag
-docs/lib/option/tagstyle
-docs/lib/option/tolerant
-docs/lib/option/trim
-docs/lib/option/variables
-docs/lib/option/version
-docs/lib/overview
-docs/lib/plugins
-docs/lib/ref/despat
-docs/lib/related
-docs/lib/resource
-docs/lib/revision
-docs/lib/seealso
-docs/lib/summary
-docs/lib/synopsis
-docs/lib/version
-docs/pod/Base.pod
-docs/pod/Config.pod
-docs/pod/Constants.pod
-docs/pod/Context.pod
-docs/pod/Document.pod
-docs/pod/Exception.pod
-docs/pod/Filters.pod
-docs/pod/Iterator.pod
-docs/pod/Parser.pod
-docs/pod/Plugin.pod
-docs/pod/Plugins.pod
-docs/pod/Provider.pod
-docs/pod/README
-docs/pod/Service.pod
-docs/pod/Stash.pod
-docs/pod/Template.pod
-docs/pod/Test.pod
-docs/src/Base.pod
-docs/src/Config.pod
-docs/src/Constants.pod
-docs/src/Context.pod
-docs/src/Document.pod
-docs/src/Exception.pod
-docs/src/Filters.pod
-docs/src/Iterator.pod
-docs/src/Parser.pod
-docs/src/Plugin.pod
-docs/src/Plugins.pod
-docs/src/Provider.pod
-docs/src/Service.pod
-docs/src/Stash.pod
-docs/src/Template.pod
-docs/src/Test.pod
-docs/ttree.cfg
lib/Template.pm
+lib/Template.pod
lib/Template/Base.pm
+lib/Template/Base.pod
lib/Template/Config.pm
+lib/Template/Config.pod
lib/Template/Constants.pm
+lib/Template/Constants.pod
lib/Template/Context.pm
+lib/Template/Context.pod
lib/Template/Directive.pm
lib/Template/Document.pm
+lib/Template/Document.pod
lib/Template/Exception.pm
+lib/Template/Exception.pod
lib/Template/Filters.pm
+lib/Template/Filters.pod
lib/Template/Grammar.pm
lib/Template/Iterator.pm
+lib/Template/Iterator.pod
lib/Template/Parser.pm
+lib/Template/Parser.pod
lib/Template/Plugin.pm
+lib/Template/Plugin.pod
lib/Template/Plugin/CGI.pm
lib/Template/Plugin/Datafile.pm
lib/Template/Plugin/Date.pm
@@ -142,11 +40,16 @@ lib/Template/Plugin/URL.pm
lib/Template/Plugin/XML/DOM.pm
lib/Template/Plugin/XML/RSS.pm
lib/Template/Plugins.pm
+lib/Template/Plugins.pod
lib/Template/Provider.pm
+lib/Template/Provider.pod
lib/Template/README
lib/Template/Service.pm
+lib/Template/Service.pod
lib/Template/Stash.pm
+lib/Template/Stash.pod
lib/Template/Test.pm
+lib/Template/Test.pod
parser/Grammar.pm.skel
parser/Parser.yp
parser/README
@@ -185,10 +88,13 @@ t/object.t
t/output.t
t/parser.t
t/plugins.t
+t/process.t
t/provider.t
+t/ref.t
t/rss.t
t/service.t
t/skel.t
+t/stash.t
t/stop.t
t/switch.t
t/table.t
@@ -199,6 +105,7 @@ t/test/lib/badrawperl
t/test/lib/barfed
t/test/lib/blockdef
t/test/lib/config
+t/test/lib/content
t/test/lib/default
t/test/lib/error
t/test/lib/footer
@@ -231,5 +138,6 @@ t/try.t
t/url.t
t/vars.t
t/varsv1.t
+t/vmeth.t
t/while.t
t/wrapper.t
View
@@ -7,8 +7,6 @@
^blib/
^pm_to_blib$
^parser/Parser\.output
-^docs/design/
-^docs/tpj/
-^docs/about
-^docs/release
-
+^docs/
+^clib/
+^t/test/src/complex.org
View
@@ -47,13 +47,13 @@ EOF
}
-my $man3pods = {
- map { ("docs/pod/$_.pod"
- => "\$(INST_MAN3DIR)/Template::$_.\$(MAN3EXT)") }
- qw( Base Config Constants Context Document Exception Filters
- Iterator Parser Plugin Plugins Provider Service Stash Test )
-};
-$man3pods->{'docs/pod/Template.pod'} = '$(INST_MAN3DIR)/Template.$(MAN3EXT)';
+# my $man3pods = {
+# map { ("docs/pod/$_.pod"
+# => "\$(INST_MAN3DIR)/Template::$_.\$(MAN3EXT)") }
+# qw( Base Config Constants Context Document Exception Filters
+# Iterator Parser Plugin Plugins Provider Service Stash Test )
+# };
+# $man3pods->{'docs/pod/Template.pod'} = '$(INST_MAN3DIR)/Template.$(MAN3EXT)';
my %opts = (
'NAME' => 'Template',
@@ -62,7 +62,7 @@ my %opts = (
'EXE_FILES' => [ 'bin/tpage', 'bin/ttree' ],
'PMLIBDIRS' => [ 'lib' ],
'PREREQ_PM' => { 'AppConfig' => 1.52 },
- 'MAN3PODS' => $man3pods,
+# 'MAN3PODS' => $man3pods,
'dist' => {
'COMPRESS' => 'gzip',
'SUFFIX' => 'gz',
@@ -84,7 +84,7 @@ WriteMakefile( %opts );
sub build_docs {
return <<EOF;
echo "Building documentation for version \$(VERSION)" ; \\
-\$(PERL) bin/ttree -f ./docs/ttree.cfg -a; \\
+\$(PERL) bin/ttree -f ./docs/ttdist.cfg --define version=\$(VERSION) -a; \\
EOF
}
Oops, something went wrong.

0 comments on commit 0b63aae

Please sign in to comment.