Permalink
Browse files

Moving to MakeMaker, updating the docs, this is 0.061

  • Loading branch information...
Ido Perlmuter
Ido Perlmuter committed Feb 24, 2010
1 parent 06bdc4e commit dcbed8d2b1bca03b83628158fcdefbacd596cd79
View
@@ -1,5 +1,11 @@
Revision history for Perl extension Tenjin
+0.061 2010-02-24 17:00:00
+ - Restored the ability to nest layout templates
+ - Restored the layou templates precedence to the same used in plTenjin
+ - Renamed the context variable back to $_context
+ - Added some real CPAN tests to the distro
+
0.06 2010-02-24 12:30:00
- Restored the layout template feature which went MIA on 0.05
- Broadened the documentation for the layout template feature
View
@@ -1,15 +1,4 @@
Changes
-inc/Module/AutoInstall.pm
-inc/Module/Install.pm
-inc/Module/Install/AutoInstall.pm
-inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/Fetch.pm
-inc/Module/Install/Include.pm
-inc/Module/Install/Makefile.pm
-inc/Module/Install/Metadata.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
lib/Tenjin.pm
lib/Tenjin/Context.pm
lib/Tenjin/Preprocessor.pm
@@ -22,8 +11,19 @@ t/00-load.t
t/manifest.t
t/pod.t
t/pod-coverage.t
-t/test_tmpl.pl
-t/test_tmpl.html
-t/test_layout_tmpl.html
-t/test_layout_tmpl_2.html
-t/test_capt.html
+t/capture_placeholder.t
+t/layout_precedence.t
+t/utils.t
+t/nested_layouts.t
+t/data/capture_placeholder/capture.html
+t/data/capture_placeholder/placeholder.html
+t/data/layout_precedence/content.html
+t/data/layout_precedence/context_layout.html
+t/data/layout_precedence/render_layout.html
+t/data/layout_precedence/instance_layout.html
+t/data/nested_layouts/top.html
+t/data/nested_layouts/inside_layout.html
+t/data/nested_layouts/outside_layout.html
+t/data/utils/encode_url.html
+t/data/utils/escape_xml.html
+t/data/utils/pP.html
View
@@ -1,18 +1,21 @@
-use inc::Module::Install 0.77;
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
-if ( -e 'MANIFEST.SKIP' ) {
- system( 'pod2text lib/Tenjin.pm > README' );
-}
-
-perl_version '5.008';
-
-name 'Tenjin';
-all_from 'lib/Tenjin.pm';
-
-requires 'Encode' => 0;
-requires 'HTML::Entities' => 0;
-
-test_requires 'Test::More';
-
-auto_install;
-WriteAll;
+WriteMakefile(
+ NAME => 'Tenjin',
+ AUTHOR => q{Ido Perlmuter <ido@ido50.net>},
+ VERSION_FROM => 'lib/Tenjin.pm',
+ ABSTRACT_FROM => 'lib/Tenjin.pm',
+ ($ExtUtils::MakeMaker::VERSION >= 6.3002
+ ? ('LICENSE'=> 'perl')
+ : ()),
+ PL_FILES => {},
+ PREREQ_PM => {
+ 'Test::More' => 0,
+ 'Encode' => 0,
+ 'HTML::Entities' => 0,
+ },
+ dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+ clean => { FILES => 'Tenjin-*' },
+);
View
68 README
@@ -20,7 +20,7 @@ SYNOPSIS
print $output;
VERSION
- 0.06
+ 0.061
DESCRIPTION
Tenjin is a very fast and full-featured templating engine, implemented
@@ -50,12 +50,12 @@ DESCRIPTION
* The "pltenjin" script is not provided, at least for now.
- To make it clear, this version of Tenjin might somehow divert from the
- original Tenjin's roadmap. Although my aim is to be as compatible as
- possible (and this version is always updated with features and changes
- from the original), I cannot guarantee it. Please note that version 0.05
- (and above) of this module is NOT backwards compatible with previous
- versions.
+ To make it clear, the CPAN version of Tenjin might find itself diverting
+ a bit in the future from the original Tenjin's roadmap. Although my aim
+ is to be as compatible as possible (and this version is always updated
+ with features and changes from the original), I cannot guarantee it (but
+ I'll do my best). Please note that version 0.05 (and above) of this
+ module is NOT backwards compatible with previous versions.
METHODS
new( \%options )
@@ -90,13 +90,13 @@ METHODS
* encoding - Another way to set the encoding of your template files
(set to utf8 by default).
- render( $tmpl_name, [\%context, $use_layout] )
+ render( $tmpl_name, [\%_context, $use_layout] )
Renders a template whose name is identified by $tmpl_name. Remember that
a prefix and a postfix might be added if they where set when creating
the Tenjin instance.
- $context is a hash-ref containing the variables that will be available
- for usage inside the templates. So, for example, if your "\%context" is
+ $_context is a hash-ref containing the variables that will be available
+ for usage inside the templates. So, for example, if your "\%_context" is
"{ message => 'Hi there' }", then you can use $message inside your
templates.
@@ -112,10 +112,15 @@ METHODS
use a different layout template (or if you haven't defined a layout
template when creating the Tenjin instance), then you must add the
layout template's name to the context as '_layout'. You can also just
- pass the layout template's name as $use_layout, which has precedence
- over "$context->{_layout}". If $use_layout is 0 or undefined, then a
- layout template will not be used, even if "$context->{_layout}" is
- defined.
+ pass the layout template's name as $use_layout, but
+ "$_context->{_layout}" has precedence.
+
+ If $use_layout is 0, then a layout template will not be used, even if
+ "$_context->{_layout}" is defined.
+
+ Note that you can nest layout templates as much as you like, but the
+ only way to do so is by setting the layout template for each template in
+ the nesting chain with "$_context->{_layout}".
Please note that by default file templates are cached on disk (with a
'.cache') extension. Tenjin automatically deprecates these cache files
@@ -147,7 +152,7 @@ METHODS
$tenjin->register_template($tmpl_name, $template);
INTERNAL METHODS
- get_template( $template_name, $context )
+ get_template( $template_name, $_context )
Receives the name of a template and the context object and tries to find
that template in the engine's memory. If it's not there, it will try to
find it in the file system (the cache file might be loaded, if present).
@@ -165,7 +170,7 @@ INTERNAL METHODS
the configuration options (or, if a path was not set, in the current
working directory). Returns the absolute path to the file.
- read_template_file( $template, $filename, $context )
+ read_template_file( $template, $filename, $_context )
Receives a template object and its absolute file path and reads that
file. If preprocessing is on, preprocessing will take place using the
provided context object.
@@ -183,7 +188,7 @@ INTERNAL METHODS
template object, reads the cache file and stores it in the template
object (as 'script').
- create_template( $filename, $context )
+ create_template( $filename, $_context )
Receives an absolute path to a template file and the context object,
reads the file, processes it (which may involve loading the template's
cache file or creating the template's cache file), compiles it and
@@ -230,18 +235,27 @@ CHANGES
utility methods of Tenjin::Util natively inside templates. You will want
to remove your templates' .cache files when upgrading to 0.6 too.
-TODO
- * Expand pod documentation and properly document the code, which is
- hard to understand as it is.
+AUTHOR
+ The CPAN version of Tenjin was forked by Ido Perlmuter <ido at
+ ido50.net> from version 0.0.2 of the original plTenjin, which is
+ developed by Makoto Kuwata at <http://www.kuwata-lab.com/tenjin/>.
- * Create tests, adapted from the tests provided by the original
- Tenjin.
+ACKNOWLEDGEMENTS
+ I would like to thank the following people for their contributions:
-AUTHOR
- Tenjin is developed by Makoto Kuwata at
- <http://www.kuwata-lab.com/tenjin/>. The CPAN version was tidied and
- CPANized from the original 0.0.2 source (with later updates from Makoto
- Kuwata's tenjin github repository) by Ido Perlmuter <ido@ido50.net>.
+ * Makoto Kuwata
+
+ The original developer of Tenjin.
+
+ * John Beppu <beppu at cpan.org>
+
+ For introducing me to Tenjin and helping me understand the way it's
+ designed.
+
+ * Pedro Melo <melo at cpan.org>
+
+ For helping me understand the logic behind some of the original
+ Tenjin aspects and helping me fix bugs and create tests.
BUGS
Please report any bugs or feature requests to "bug-tenjin at
Oops, something went wrong.

0 comments on commit dcbed8d

Please sign in to comment.