} else {
my $uri = URI->new( $args->{file} );
my @ext = qw( .html .htm .json .jsn .yaml .yml .gif .png .jpg .jpeg .csv .xls .xlsx .sxc .ods );
my (undef,undef,$su
TML::_parse( $args );
} elsif ($file =~ /\.jso?n$/) {
return Spreadsheet::HTML::File::JSON::_parse( $args );
} elsif ($file =~ /\.ya?ml$/) {
return Spreadsheet::HTML::File::YAM
.htm' )
generate( file => 'foo.html' )
=item * JSON
Parses with (requires) L<JSON>.
generate( file => 'foo.jsn' )
generate( file => 'foo.json' )
=item * YAML
Parses with (requires) L<YAML>.
e Spreadsheet::HTML::Presets::Handson;
use strict;
use warnings FATAL => 'all';
eval "use JSON";
our $NO_JSON = $@;
sub handson {
my ($self,$data,$args);
$self = shift if ref($_[0]) =~ /^Spr
;
$args->{json} = '';
if ($NO_JSON) {
$args->{json} = '{' . join( ', ', map "$_: $args->{args}{$_}", keys %{ $args->{args} } ) . '}';
} else {
my $json = JSON->new->allow_n
onref;
$args->{json} = $json->encode( $args->{args} );
$args->{json} =~ s/"//g;
}
$args->{id} ||= 'handsontable';
my @args = (
@_,
empty => undef,
;
}
unless (ref $args->{map}) {
$args->{data} = [[ 'Error' ],[ 'map is not valid JSON' ]];
return $self ? $self->generate( %$args ) : Spreadsheet::HTML::generate( %$args );
p => '/path/to/mappings.json',
);
# or
use Spreadsheet::HTML qw( beadwork );
print beadwork(
art => '/path/to/ascii-art.txt',
map => '/path/to/mappings.json',
);
=head1 METHODS
of ASCII art.
beadwork(
art => '/path/to/ascii-art.txt',
map => '/path/to/mappings.json',
bgcolor => 'gray',
)
C<art> contains the ASCII picture and C<map> contains the color
f
nd mazes, and create
animations of cell values and backgrounds via jQuery. Transform Excel, HTML,
JSON, CSV, YAML, PNG, JPEG and GIF files instantly into HTML tables.
=head1 CLI TOOLS
=over 4
=item
ing. The name of the data file to read. Supported formats
are XLS, CSV, JSON, YAML, HTML, GIF, PNG and JPG.
file => 'foo.json'
C<file> overrides C<data>. You generally either specify C<data>
or C<
e created on your behalf, you can
also supply a URI:
file => 'http://your.site.com/path/to/foo.json'
The temp file will be unlinked unless you set the super secret hidden
param C<_unlink> to zero