Text-APL
view release on metacpan or search on metacpan
{
"abstract" : "non-blocking and streaming capable template engine",
"author" : [
"Viacheslav Tykhanovskyi, C<vti@cpan.org>."
],
"dynamic_config" : 0,
"generated_by" : "Minilla/v3.0.13",
"license" : [
"artistic_2"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
---
abstract: 'non-blocking and streaming capable template engine'
author:
- 'Viacheslav Tykhanovskyi, C<vti@cpan.org>.'
build_requires: {}
configure_requires:
Module::Build::Tiny: '0.035'
dynamic_config: 0
generated_by: 'Minilla/v3.0.13, CPAN::Meta::Converter version 2.150010'
license: artistic_2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
__END__
=pod
=head1 NAME
Text::APL - non-blocking and streaming capable template engine
=head1 SYNOPSIS
=head2 Simple example
$template->render(
input => \$input,
output => \$output,
vars => {foo => 'bar'}
);
# Print $chunk to the needed output
# $chunk is undef when template is fully rendered
},
vars => {foo => 'bar'}
);
=head1 DESCRIPTION
This is yet another template engine. But compared to others it supports
non-blocking (read/write) and streaming output.
=head2 Reader/Writer
Reader and writer can be a subroutine references reading from any source and
writing output to any destination. Sane default implementations for reading from
a string, a file or file handle and writing to the string, a file or a file
handle are also available.
=head2 Parser
Parser can parse not only full templates but chunk by chunk correctly resolving
any ambiguous leftovers. This allows immediate parsing.
=head2 Compiler
Compiler compiles templates into Perl code but when evaluating does not create
a Perl string that accumulates all the template output, but rather provides
a special C<print> function that pushes the content as soon as it's available
(streaming).
The generated Perl code can looks like this:
Hello, <%= $nickname %>!
# becomes
__print(q{Hello, });
__print_escaped(do {$foo});
__print(q{!});
lib/Text/APL.pm view on Meta::CPAN
: Text::APL::Reader->new(@_);
}
1;
__END__
=pod
=head1 NAME
Text::APL - non-blocking and streaming capable template engine
=head1 SYNOPSIS
=head2 Simple example
$template->render(
input => \$input,
output => \$output,
vars => {foo => 'bar'}
);
lib/Text/APL.pm view on Meta::CPAN
# Print $chunk to the needed output
# $chunk is undef when template is fully rendered
},
vars => {foo => 'bar'}
);
=head1 DESCRIPTION
This is yet another template engine. But compared to others it supports
non-blocking (read/write) and streaming output.
=head2 Reader/Writer
Reader and writer can be a subroutine references reading from any source and
writing output to any destination. Sane default implementations for reading from
a string, a file or file handle and writing to the string, a file or a file
handle are also available.
=head2 Parser
lib/Text/APL.pm view on Meta::CPAN
This for example works just fine:
$parser->parse('<% $hello');
$parser->parse(' %>');
=head2 Compiler
Compiler compiles templates into Perl code but when evaluating does not create
a Perl string that accumulates all the template output, but rather provides
a special C<print> function that pushes the content as soon as it's available
(streaming).
The generated Perl code can looks like this:
Hello, <%= $nickname %>!
# becomes
__print(q{Hello, });
__print_escaped(do {$foo});
__print(q{!});
( run in 0.762 second using v1.01-cache-2.11-cpan-4d50c553e7e )