X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FLearn.pm;fp=lib%2FGruntmaster%2FPage%2FLearn.pm;h=8fce8c8dc213a4aacac9957d4d79fd46cf4bae27;hb=12f5cac9d95e04bb84e47952dd938031557b57c4;hp=0000000000000000000000000000000000000000;hpb=96f80a6301593b18f21e003fe48a6af750eecf61;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Learn.pm b/lib/Gruntmaster/Page/Learn.pm new file mode 100644 index 0000000..8fce8c8 --- /dev/null +++ b/lib/Gruntmaster/Page/Learn.pm @@ -0,0 +1,35 @@ +package Gruntmaster::Page::Learn; + +use 5.014000; +use strict; +use warnings; +use parent qw/Exporter/; +our @EXPORT_OK = qw/generate/; +our $VERSION = '0.001'; + +use constant FORMATS => [qw/CPP/]; +use constant TITLE => 'Learn Perl'; + +use Fcntl qw/:flock/; +use HTML::Template::Compiled; +use IO::File; +use YAML::Any qw/LoadFile/; +use Gruntmaster::Page::Common qw/header footer/; + +my %templates = ( + en => <<'HTML', +Download interactive-perl-tutorial for Linux | Windows | Mac OS X. +

Get the source from meta::cpan +HTML +); + +$templates{$_} = header($_, TITLE) . $templates{$_} for keys %templates; +$templates{$_} .= footer $_ for keys %templates; + +sub generate{ + my $template = $templates{$_[1]}; + my $htc = HTML::Template::Compiled->new(scalarref => \$template); + $htc->output +} + +1