--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Syntax::Highlight::Perl;
+
+my $color_table = {
+ 'Variable_Scalar' => 'color:#080;',
+ 'Variable_Array' => 'color:#f70;',
+ 'Variable_Hash' => 'color:#80f;',
+ 'Variable_Typeglob' => 'color:#f03;',
+ 'Subroutine' => 'color:#980;',
+ 'Quote' => 'color:#00a;',
+ 'String' => 'color:#00a;',
+ 'Comment_Normal' => 'color:#069;font-style:italic;',
+ 'Comment_POD' => 'color:#014;font-size:11pt;',
+ 'Bareword' => 'color:#3A3;',
+ 'Package' => 'color:#900;',
+ 'Number' => 'color:#f0f;',
+ 'Operator' => 'color:#000;',
+ 'Symbol' => 'color:#000;',
+ 'Keyword' => 'color:#000;',
+ 'Builtin_Operator' => 'color:#300;',
+ 'Builtin_Function' => 'color:#001;',
+ 'Character' => 'color:#800;',
+ 'Directive' => 'color:#399;font-style:italic;',
+ 'Label' => 'color:#939;font-style:italic;',
+ 'Line' => 'color:#000;',
+};
+
+my $formatter = Syntax::Highlight::Perl->new();
+
+$formatter->define_substitution(
+ '<' => '<',
+ '>' => '>',
+ '&' => '&'
+);
+
+while ( my ( $type, $style ) = each %{$color_table} ) {
+ $formatter->set_format(
+ $type,
+ [
+ qq|<span style="$style">|,
+ '</span>'
+ ]
+ );
+}
+
+my $file = shift || die "Give me a perl file to colorize!\n";
+-e $file or die "There's no such file: $file\n";
+
+open F, '<', $file or die $!;
+
+print '<pre style="font-size:10pt;color:#336;">';
+while (<F>) {
+ print $formatter->format_string;
+}
+print "</pre>";
+close F;
+
+exit 0;
+
+1;
--- /dev/null
+package Point;
+use Moose; # automatically turns on strict and warnings
+
+has 'x' => (is => 'rw', isa => 'Int');
+has 'y' => (is => 'rw', isa => 'Int');
+
+sub clear {
+ my $self = shift;
+ $self->x(0);
+ $self->y(0);
+}
+
+package Point3D;
+use Moose;
+
+extends 'Point';
+
+has 'z' => (is => 'rw', isa => 'Int');
+
+after 'clear' => sub {
+ my $self = shift;
+ $self->z(0);
+};
\ No newline at end of file
msgid "nav presentations"
msgstr "Presentations"
-# misc
-
-msgid "moose code sample"
-msgstr ""
-"<pre>"
-"package Point;\n"
-"use Moose;\n"
-"\n"
-"has 'x' => (is => 'rw', isa => 'Int');\n"
-"has 'y' => (is => 'rw', isa => 'Int');\n"
-"\n"
-"sub clear {\n"
-" my $self = shift;\n"
-" $self->x(0);\n"
-" $self->y(0);\n"
-"}\n"
-"\n"
-"package Point3D;\n"
-"use Moose;\n"
-"\n"
-"extends 'Point';\n"
-"\n"
-"has 'z' => (is => 'rw', isa => 'Int');\n"
-"\n"
-"after 'clear' => sub {\n"
-" my $self = shift;\n"
-" $self->z(0);\n"
-"};\n"
-"</pre>"
-
# home
msgid "home body"
--- /dev/null
+<pre style="font-size:10pt;color:#336;"><span style="color:#000;">package</span> <span style="color:#900;">Point</span><span style="color:#000;">;</span>
+<span style="color:#000;">use</span> <span style="color:#900;">Moose</span><span style="color:#000;">;</span> <span style="color:#069;font-style:italic;"># automatically turns on strict and warnings</span>
+
+<span style="color:#3A3;">has</span> <span style="color:#00a;">'</span><span style="color:#00a;">x</span><span style="color:#00a;">'</span> <span style="color:#000;">=></span> <span style="color:#000;">(</span><span style="color:#00a;">is</span> <span style="color:#000;">=></span> <span style="color:#00a;">'</span><span style="color:#00a;">rw</span><span style="color:#00a;">'</span><span style="color:#000;">,</span> <span style="color:#00a;">isa</span> <span style="color:#000;">=></span> <span style="color:#00a;">'</span><span style="color:#00a;">Int</span><span style="color:#00a;">'</span><span style="color:#000;">)</span><span style="color:#000;">;</span>
+<span style="color:#3A3;">has</span> <span style="color:#00a;">'</span><span style="color:#00a;">y</span><span style="color:#00a;">'</span> <span style="color:#000;">=></span> <span style="color:#000;">(</span><span style="color:#00a;">is</span> <span style="color:#000;">=></span> <span style="color:#00a;">'</span><span style="color:#00a;">rw</span><span style="color:#00a;">'</span><span style="color:#000;">,</span> <span style="color:#00a;">isa</span> <span style="color:#000;">=></span> <span style="color:#00a;">'</span><span style="color:#00a;">Int</span><span style="color:#00a;">'</span><span style="color:#000;">)</span><span style="color:#000;">;</span>
+
+<span style="color:#000;">sub</span> <span style="color:#980;">clear</span> <span style="color:#000;">{</span>
+ <span style="color:#000;">my</span> <span style="color:#080;">$self</span> <span style="color:#000;">=</span> <span style="color:#300;">shift</span><span style="color:#000;">;</span>
+ <span style="color:#080;">$self</span><span style="color:#000;">-></span><span style="color:#980;">x</span><span style="color:#000;">(</span><span style="color:#f0f;">0</span><span style="color:#000;">)</span><span style="color:#000;">;</span>
+ <span style="color:#080;">$self</span><span style="color:#000;">-></span><span style="color:#00a;">y(</span><span style="color:#00a;">0</span><span style="color:#00a;">)</span><span style="color:#000;">;</span>
+<span style="color:#000;">}</span>
+
+<span style="color:#000;">package</span> <span style="color:#900;">Point3D</span><span style="color:#000;">;</span>
+<span style="color:#000;">use</span> <span style="color:#900;">Moose</span><span style="color:#000;">;</span>
+
+<span style="color:#3A3;">extends</span> <span style="color:#00a;">'</span><span style="color:#00a;">Point</span><span style="color:#00a;">'</span><span style="color:#000;">;</span>
+
+<span style="color:#3A3;">has</span> <span style="color:#00a;">'</span><span style="color:#00a;">z</span><span style="color:#00a;">'</span> <span style="color:#000;">=></span> <span style="color:#000;">(</span><span style="color:#00a;">is</span> <span style="color:#000;">=></span> <span style="color:#00a;">'</span><span style="color:#00a;">rw</span><span style="color:#00a;">'</span><span style="color:#000;">,</span> <span style="color:#00a;">isa</span> <span style="color:#000;">=></span> <span style="color:#00a;">'</span><span style="color:#00a;">Int</span><span style="color:#00a;">'</span><span style="color:#000;">)</span><span style="color:#000;">;</span>
+
+<span style="color:#3A3;">after</span> <span style="color:#00a;">'</span><span style="color:#00a;">clear</span><span style="color:#00a;">'</span> <span style="color:#000;">=></span> <span style="color:#000;">sub</span> <span style="color:#000;">{</span>
+ <span style="color:#000;">my</span> <span style="color:#080;">$self</span> <span style="color:#000;">=</span> <span style="color:#300;">shift</span><span style="color:#000;">;</span>
+ <span style="color:#080;">$self</span><span style="color:#000;">-></span><span style="color:#980;">z</span><span style="color:#000;">(</span><span style="color:#f0f;">0</span><span style="color:#000;">)</span><span style="color:#000;">;</span>
+<span style="color:#000;">}</span><span style="color:#000;">;</span></pre>
\ No newline at end of file
[% INCLUDE 'shared/footer.tt' %]
</div>
<div id="code_sample" style="display:none">
- [% loc('moose code sample') %]
+[% INCLUDE 'code/point.tt' %]
</div>
</body>
</html>
\ No newline at end of file
padding : 10px;
border : 1px dotted #aaaaaa;
color : #333333;
- width : 550px;
+ width : 500px;
}
ul {