]> iEval git - gruntmaster-page.git/blame - lib/Gruntmaster/Page/Learn.pm
Centralize template cooking and introduce reloadable templates
[gruntmaster-page.git] / lib / Gruntmaster / Page / Learn.pm
CommitLineData
12f5cac9
MG
1package Gruntmaster::Page::Learn;
2
3use 5.014000;
4use strict;
5use warnings;
6use parent qw/Exporter/;
7our @EXPORT_OK = qw/generate/;
8our $VERSION = '0.001';
9
12f5cac9 10use HTML::Template::Compiled;
2b0036ac 11use Gruntmaster::Page::Common qw/cook_templates reload_templates/;
12f5cac9 12
2b0036ac 13my %orig_templates = (
12f5cac9 14 en => <<'HTML',
cd9af27e
MG
15Install interactive-perl-tutorial from your nearest CPAN mirror. Run <code>cpan App::InteractivePerlTutorial</code>.
16<p>You can also get the source from <a href="http://git.ieval.ro/?p=app-interactiveperltutorial.git">git.ieval.ro</a>
12f5cac9
MG
17HTML
18);
19
2b0036ac 20my %templates = cook_templates %orig_templates, learn => 'Learn';
12f5cac9
MG
21
22sub generate{
2b0036ac 23 %templates = cook_templates %orig_templates, learn => 'Learn' if reload_templates;
cd9af27e 24 HTML::Template::Compiled->new(scalarref => \$templates{$_[1]})->output;
12f5cac9
MG
25}
26
271
This page took 0.02565 seconds and 4 git commands to generate.