TT2-Play-Area

 view release on metacpan or  search on metacpan

lib/TT2/Play/Area.pm  view on Meta::CPAN


sub load_settings {
    my $file   = shift;
    my ($name) = $file->stringify =~ /(\w+)\.settings$/;
    my $data   = decode_json( $file->slurp_utf8 );
    return ( $name, $data );
}

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

TT2::Play::Area - Simple site to allow playing with TT2 syntax and built in plugins.

=head1 VERSION

version 0.002

=head1 DESCRIPTION

This is a mini site for testing L<Template> Toolkit 2 and L<Template::Alloy>
rendering in a similar way to sites like jsFiddle.  It provides a pane for
editing the template, and a pane for providing the variables to pass it (in
JSON).

Currently supported 'engines' are,

=over

=item * Template (TT2)

=item * Template::Alloy

=item * Template::Alloy (using AUTO_FILTER html)

=back

On the front end jQuery and CodeMirror are used to provide the UI.

=head1 RUNNING 

The site is automatically built into a docker container on quay.io so if
you simply want to spin it up the quickest way is to,

    docker run -d -p5000:5000 quay.io/colinnewell/tt2-play-area:latest

This will expose it on port 5000 on localhost, so you should be able to
browse to L<http://localhost:5000>.

Alternatively, if you've installed the module from CPAN then you can run it
using plackup like this,

    plackup `which tt2-play-area.psgi`

Note that if you run with starman you need to use the C<--preload-app>
option otherwise you will get 403 errors when trying to process the
templates because the CSRF prevention mechanism gets in the way.

Or if you checkout the github repo like this,

    cpanm --installdeps .
    plackup -I lib bin/tt2-play-area.psgi

=head1 AUTHOR

Colin Newell <colin.newell@gmail.com>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 by Colin Newell.

This is free software, licensed under:

  The MIT (X11) License

=cut



( run in 1.552 second using v1.01-cache-2.11-cpan-df04353d9ac )