X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/0ec1918e9ea19466404dd204c30dea88af25bea7..f1614fb2f16c1e75c8dcef8a9d3e1e46cc236bee:/cc.plp diff --git a/cc.plp b/cc.plp index 08a2341..afd10ed 100644 --- a/cc.plp +++ b/cc.plp @@ -15,7 +15,13 @@ $header{content_type} = 'text/html; charset=utf-8'; 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; +:> @@ -34,9 +40,9 @@ sub quote { { printf ''; - print ''; + print ''; for my $section (qw{thead}) { - print "<$section>
↱"; + print "<$section>
↳"; print '', $_ for 'a' .. 'z'; print "\n"; } @@ -63,13 +69,13 @@ sub quote { s/ republic\b//gi; s/ islands?\b//gi; s/\bthe //g; - s/ and / & /g; + s/ and / & /g and s/(?<=.)[a-z ]+//g; s/\bsaint /st /gi; - s/South /S-/g; - s/North /N-/g; + s/South(?:ern)? /S-/g; + 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])(\S{2,})/$1./g; # abbreviate (at consonant) + s/(\S{4}[b-df-hj-np-tv-xz])(\w{2,})/$1./g; # abbreviate (at consonant) $_ = quote($_); } $name =~ s/([^,]*), (.*)/$2 $1/; @@ -89,21 +95,33 @@ sub quote { africa europe asia - oceania antarctica + oceania south america north america - reserved + reserved user-assigned
+ +
+ +