From 12a4bdfabf59bc6051bbd6f65772e830165eb904 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 18 Jul 2013 10:25:47 -0400 Subject: more docs --- lib/Spreadsheet/Template/Processor/Xslate.pm | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'lib/Spreadsheet/Template/Processor/Xslate.pm') diff --git a/lib/Spreadsheet/Template/Processor/Xslate.pm b/lib/Spreadsheet/Template/Processor/Xslate.pm index b6551ac..34e4ebf 100644 --- a/lib/Spreadsheet/Template/Processor/Xslate.pm +++ b/lib/Spreadsheet/Template/Processor/Xslate.pm @@ -6,6 +6,57 @@ use Text::Xslate; with 'Spreadsheet::Template::Processor'; +=head1 SYNOPSIS + + my $template = Spreadsheet::Template->new( + processor_class => 'Spreadsheet::Template::Processor::Xslate', + processor_options => { + syntax => 'TTerse' + }, + ); + +=head1 DESCRIPTION + +This class implements L to run the template +data through L. In addition to allowing you to use the provided +variables, it also provides some convenience macros to use when writing your +templates: + +=over 4 + +=item format($name, $options) + +Declares a named format, which can be used with the C helper. C<$name> is +the name to use for the format, and C<$options> is a hashref to use as the +value for the C entry in the cell. + +=item c($contents, $format, $type, %args) + +Returns the representation of a cell. C<$contents> is the cell contents, +C<$format> is either the name of a format declared with the C helper, +or a hashref of format options, C<$type> is either C<"string">, C<"number">, or +C<"date_time">, and C<%args> contains any other parameters (such as C, +for instance) to declare for the cell. C<$type> is optional, and if not passed, +defaults to C<"string">. + +=item true + +Returns C. + +=item false + +Returns C. + +=back + +=cut + +=attr syntax + +Which Xslate syntax engine to use. Defaults to C. + +=cut + has syntax => ( is => 'ro', isa => 'Str', -- cgit v1.2.3-54-g00ecf