Dancer::Plugin::Transformator - Dancer plugin for Net::NodeTransformator
version 0.002
use Dancer::Plugin::Transformator; set plugins => { Transformator => { connect => 'localhost:12345', } }; get '/' => sub { transform_output 'jade'; transform_output 'minify_html'; return template 'index'; };
transform($engine, $input[, $data])
A wrapper method for Net::NodeTransformator::transform.
transform_output($engine[, $data])
Creates an after-hook and transform the response content via specified engine. Multiple calls of this method causes the engines to be chained. In the synopsis example above, the content of the template output is first transformed via jade and then minified. The argument $data is only meaningful for jade engine.
$data
The plugin needs only one setting, the connect parameter. See documentation of Net::NodeTransformator for more information about the syntax. If omitted, a standalone server will be started.
connect
Net::NodeTransformator
1;
Please report any bugs or feature requests on the bugtracker website https://github.com/zurborg/libdancer-plugin-transformator-perl/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
David Zurborg <zurborg@cpan.org>
This software is Copyright (c) 2014 by David Zurborg.
This is free software, licensed under:
The ISC License
To install Dancer::Plugin::Transformator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Plugin::Transformator
CPAN shell
perl -MCPAN -e shell install Dancer::Plugin::Transformator
For more information on module installation, please visit the detailed CPAN module installation guide.