X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/f1614fb2f16c1e75c8dcef8a9d3e1e46cc236bee..0b4be0d5ff71ca539da8e741826d499a5d649004:/cc.plp?ds=sidebyside
diff --git a/cc.plp b/cc.plp
index afd10ed..7d1b0d8 100644
--- a/cc.plp
+++ b/cc.plp
@@ -1,27 +1,17 @@
-<:
-use utf8;
-use strict;
-use warnings;
-use open IO => ':utf8';
-
-our $VERSION = 'v1.0';
-
-$header{content_type} = 'text/html; charset=utf-8';
+<(common.inc.plp)><:
+ our $VERSION = 'v1.0';
:>
-
+
country code cheat sheet
-<:
- my %styles = map {$_ => $_} qw(dark mono red);
- our $style = exists $get{style} && $styles{$get{style}} || 'light';
- printf(qq{\n},
- $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css", $_
- ) for keys %styles;
-:>
+
+
+<:= stylesheet(qw'light dark mono red') :>
+
@@ -30,14 +20,6 @@ $header{content_type} = 'text/html; charset=utf-8';
<:
my $cc = do 'cc.inc.pl';
-sub quote {
- local $_ = shift;
- s/"/"/g;
- s/</g;
- s/>/>/g;
- return $_;
-}
-
{
printf '';
print '';
@@ -75,12 +57,12 @@ sub quote {
s/North(?:ern)? /N-/g;
s/New /n./g;
s/(\S)(\S+)-/$1-/g; # strip most chars preceding dash
- s/(\S{4}[b-df-hj-np-tv-xz])(\w{2,})/$1./g; # abbreviate (at consonant)
- $_ = quote($_);
+ s/(\S{4}[b-df-hj-np-tv-xz])((?%s',
- $_ ? 'X '.$class : '', quote("$code: $name"), $_;
+ $_ ? 'X '.$class : '', EscapeHTML("$code: $name"), $_;
}
print "\n";
}