...
 
Commits (11)
Revision history for perl module Text::Hogan
1.07 2018-12-21
* Variable $key and $Key typo (thanks Yanick Champoux!)
1.06 2018-09-30
* Update SEE ALSO section in POD (thanks Mohammad S Anwar :-))
1.05 2018-09-29
* Bug fixes for as_string (thanks Tony Finch for catching 3 different bugs!)
1.04 2016-11-02
* Prefer array over arrayref (thanks Tom Hukins!)
* Add copyright_holder to dist.ini (thanks Tom Hukins!)
......
This software is copyright (c) 2016 by Alex Balhatchet.
This software is copyright (c) 2018 by Alex Balhatchet.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
......@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 2016 by Alex Balhatchet.
This software is Copyright (c) 2018 by Alex Balhatchet.
This is free software, licensed under:
......@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
This software is Copyright (c) 2016 by Alex Balhatchet.
This software is Copyright (c) 2018 by Alex Balhatchet.
This is free software, licensed under:
......
......@@ -56,7 +56,7 @@
"web" : "http://github.com/kaoru/Text-Hogan"
}
},
"version" : "1.04",
"version" : "1.07",
"x_serialization_backend" : "Cpanel::JSON::XS version 3.0214"
}
......@@ -27,5 +27,5 @@ requires:
resources:
bugtracker: https://github.com/kaoru/Text-Hogan/issues
repository: git://github.com/kaoru/Text-Hogan
version: '1.04'
version: '1.07'
x_serialization_backend: 'YAML::Tiny version 1.69'
......@@ -28,7 +28,7 @@ my %WriteMakefileArgs = (
"Try::Tiny" => "0.22",
"YAML" => "1.13"
},
"VERSION" => "1.04",
"VERSION" => "1.07",
"test" => {
"TESTS" => "t/*.t"
}
......
This archive contains the distribution Text-Hogan,
version 1.04:
version 1.07:
Text::Hogan - A mustache templating engine statement-for-statement cloned from hogan.js
This software is copyright (c) 2016 by Alex Balhatchet.
This software is copyright (c) 2018 by Alex Balhatchet.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
......
name = Text-Hogan
version = 1.04
version = 1.07
abstract = Text::Hogan - A mustache templating engine statement-for-statement cloned from hogan.js
author = Alex Balhatchet
......
package Text::Hogan;
$Text::Hogan::VERSION = '1.04';
$Text::Hogan::VERSION = '1.07';
use strict;
use warnings;
......@@ -13,7 +13,7 @@ Text::Hogan - A mustache templating engine statement-for-statement cloned from h
=head1 VERSION
version 1.04
version 1.07
=head1 DESCRIPTION
......@@ -55,18 +55,22 @@ on Node.js and pre-compiles templates to pure JavaScript.
=head2 Text::Caml
L<Text::Caml|Text::Caml> is a very good mustache-like templating engine, but
does not support pre-compilation.
L<Text::Caml|Text::Caml> supports searching for partials by file name, by
default .caml but that can be configured.
=head2 Template::Mustache
L<Template::Mustache|Template::Mustache> is a module written by Pieter van de
Bruggen. Currently has no POD. Used by Dancer::Template::Mustache.
L<Template::Mustache|Template::Mustache> is used by Dancer::Template::Mustache
and Dancer2::Template::Mustache. It supports compile once, render many times,
but does not allow dumping the compiled form to disk.
=head2 Mustache::Simple
I don't know anything about L<Mustache::Simple|Mustache::Simple>. It seems to
be available on search.cpan.org but not on metacpan.org which is a bad sign.
L<Mustache::Simple|Mustache::Simple> largely supports the Mustache spec, but
skips the whitespace and decimal tests (its behaviour with decimals is the same
as Text::Hogan with 'numeric_string_as_string' option enabled.) It supports
passing objects with getters to the context hash, so that {{name}} can be
rendered from $object->name if $object->can('name') returns true.
=head1 AUTHOR
......
package Text::Hogan::Compiler;
$Text::Hogan::Compiler::VERSION = '1.04';
$Text::Hogan::Compiler::VERSION = '1.07';
use Text::Hogan::Template;
use strict;
......@@ -304,11 +304,11 @@ sub stringify_substitutions {
}
sub stringify_partials {
my $code_obj;
my $code_obj = shift;
my @partials;
for my $key (sort keys %{ $code_obj->{'partials'} }) {
push @partials, sprintf('"%s" => { "name" => "%s", %s }',
push @partials, sprintf('"%s" => { "name" => "%s", %s }', $key,
esc($code_obj->{'partials'}{$key}{'name'}),
stringify_partials($code_obj->{'partials'}{$key})
);
......@@ -322,7 +322,7 @@ sub stringify_partials {
sub stringify {
my ($self,$code_obj, $text, $options) = @_;
return sprintf('{ code => sub { my ($self,$c,$p,$i) = @_; %s }, %s }',
return sprintf('{ code => sub { my ($t,$c,$p,$i) = @_; %s }, %s }',
wrap_main($code_obj->{'code'}),
stringify_partials($code_obj)
);
......@@ -559,7 +559,7 @@ Text::Hogan::Compiler - parse templates and output Perl code
=head1 VERSION
version 1.04
version 1.07
=head1 SYNOPSIS
......
package Text::Hogan::Template;
$Text::Hogan::Template::VERSION = '1.04';
$Text::Hogan::Template::VERSION = '1.07';
use strict;
use warnings;
......@@ -353,8 +353,6 @@ sub find_in_scope {
sub create_specialized_partial {
my ($instance, $subs, $partials, $stack_subs, $stack_partials, $stack_text) = @_;
my $key;
my $Partial = clone($instance);
$Partial->{'buf'} = "";
......@@ -367,7 +365,7 @@ sub create_specialized_partial {
$stack_subs->{$key} = $subs->{$key};
}
}
for my $Key (sort keys %$stack_subs) {
for my $key (sort keys %$stack_subs) {
$Partial->{'subs'}{$key} = $stack_subs->{$key};
}
......@@ -402,7 +400,7 @@ Text::Hogan::Template - represent and render compiled templates
=head1 VERSION
version 1.04
version 1.07
=head1 SYNOPSIS
......