;
use Moose;
# ABSTRACT: generate spreadsheets from a template
use Class::Load 'load_class';
use JSON;
has processor_class => (
is => 'ro',
isa => 'Str',
default => 'Spreadshe
return $class->new($self->processor_options);
},
);
has json => (
is => 'ro',
default => sub {
return JSON->new;
}
);
sub _writer {
my $self = shift;
my $class
late, $vars);
# not decode_json, since we expect that we are already being handed a
# character string (decode_json also decodes utf8)
my $data = $self->json->decode($contents);
return
e::Generator::Parser::Excel::VERSION = '0.05';
use Moose::Role;
use DateTime::Format::Excel;
use JSON;
with 'Spreadsheet::Template::Generator::Parser';
requires '_create_workbook';
has _excel_dt =
'#ffffff'; # XXX
$format_data->{bold} = JSON::true
if $format->{Font}{Bold};
$format_data->{italic} = JSON::true
if $format->{Font}{Italic};
>{AlignV}}
unless $format->{AlignV} == 2;
$format_data->{text_wrap} = JSON::true
if $format->{Wrap};
}
if (!$format->{IgnoreNumberFormat}) {
Spreadsheet::Template::Helpers::Xslate::VERSION = '0.05';
use strict;
use warnings;
use JSON;
my $JSON = JSON->new;
use Sub::Exporter 'build_exporter';
my $import = build_exporter({
exports =>
$contents, $format, $type, %args) = @_;
$type = 'string' unless defined $type;
return $JSON->encode({
contents => "$contents",
format => _formats($package, $format),
$contents, $format, $type, %args) = @_;
$type = 'string' unless defined $type;
return $JSON->encode({
range => _parse_range($range),
contents => "$contents",
form
e;
# ABSTRACT: create new templates from existing spreadsheets
use Class::Load 'load_class';
use JSON;
has parser_class => (
is => 'ro',
isa => 'Str',
default => 'Spreadsheet:
self = shift;
my ($filename) = @_;
my $data = $self->parser->parse($filename);
return JSON->new->pretty->canonical->encode($data);
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
__EN
my $generator = Spreadsheet::Template::Generator->new;
open my $fh, '>:encoding(utf8)', 'out.json';
$fh->print($generator->generate($filename));
=head1 DESCRIPTION
This module is used to crea
right cell, or by an
Excel-style range (like C<A1:C3>).
=item true
Returns C<JSON::true>.
=item false
Returns C<JSON::false>.
=back
=head1 ATTRIBUTES
=head2 syntax
Which Xslate syntax engine
}
$properties = {
map {
my $v = $properties->{$_};
$_ => JSON::is_bool($v) ? ($v ? 1 : 0)
: $_ eq 'left' ? $border{$v}
: $
ies->{pattern}}
unless $format_properties->{pattern} =~ /^\d+$/;
}
my $key = JSON->new->canonical->encode($format_properties);
if (exists $self->_formats->{$key}) {
re
SCRIPTION
This class implements L<Spreadsheet::Template::Processor>, and just passes
through the JSON data without modification.
=for Pod::Coverage process
=head1 AUTHOR
Jesse Luehrs <doy@tozt.n
by any classes which consume this
role. It should take the contents of the template and return a JSON file as
described in L<Spreadsheet::Template>. This typically just means running it
through a tem