The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Spreadsheet::Template::Processor::Xslate - preprocess templates with Xslate

VERSION

version 0.01

SYNOPSIS

  my $template = Spreadsheet::Template->new(
      processor_class   => 'Spreadsheet::Template::Processor::Xslate',
      processor_options => {
          syntax => 'TTerse'
      },
  );

DESCRIPTION

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:

format($name, $options)

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($contents, $format, $type, %args)

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".

true

Returns JSON::true.

false

Returns JSON::false.

ATTRIBUTES

syntax

Which Xslate syntax engine to use. Defaults to Metakolon.

AUTHOR

Jesse Luehrs <doy@tozt.net>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2013 by Jesse Luehrs.

This is free software, licensed under:

  The MIT (X11) License