Spreadsheet::Template::Processor::Xslate - preprocess templates with Xslate
version 0.05
my $template = Spreadsheet::Template->new( processor_class => 'Spreadsheet::Template::Processor::Xslate', processor_options => { syntax => 'TTerse' }, );
This class implements Spreadsheet::Template::Processor to run the template data through Text::Xslate. In addition to allowing you to use the provided variables, it also provides some convenience macros to use when writing your templates:
Declares a named format, which can be used with the c helper. $name is the name to use for the format, and $options is a hashref to use as the value for the format entry in the cell.
c
$name
$options
format
Returns the representation of a cell. $contents is the cell contents, $format is either the name of a format declared with the format helper, or a hashref of format options, $type is either "string", "number", or "date_time", and %args contains any other parameters (such as formula, for instance) to declare for the cell. $type is optional, and if not passed, defaults to "string".
$contents
$format
$type
"string"
"number"
"date_time"
%args
formula
Returns representation of a range of cells to be merged. $content, $format, $type, and %args are identical to the parameters listed above for the c helper, and $range describes the range of cells to be merged. The range can be specified either by an array of two arrays corresponding to the row and column indices of the top left and bottom right cell, or by an Excel-style range (like A1:C3).
$content
$range
A1:C3
Returns JSON::true.
JSON::true
Returns JSON::false.
JSON::false
Which Xslate syntax engine to use. Defaults to Metakolon.
Metakolon
Jesse Luehrs <doy@tozt.net>
This software is Copyright (c) 2015 by Jesse Luehrs.
This is free software, licensed under:
The MIT (X11) License
To install Spreadsheet::Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Spreadsheet::Template
CPAN shell
perl -MCPAN -e shell install Spreadsheet::Template
For more information on module installation, please visit the detailed CPAN module installation guide.