cc: improve abbreviations; show options legend
[sheet.git] / cc.plp
diff --git a/cc.plp b/cc.plp
index b36d7446ae1128c7d8d4f73b549d5e5a3aaaee88..afd10edcffb242df0f9e96df96d123957e28ad95 100644 (file)
--- a/cc.plp
+++ b/cc.plp
@@ -42,7 +42,7 @@ sub quote {
        printf '<table class="mcmap">';
        print '<col><colgroup span="26">';
        for my $section (qw{thead}) {
-               print "<$section><tr><th>�";
+               print "<$section><tr><th>�";
                print '<th>', $_ for 'a' .. 'z';
                print "\n";
        }
@@ -69,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/;
@@ -102,6 +102,16 @@ sub quote {
        <td class="">reserved
        <td class="X Co">user-assigned
        </table>
+
+       <div class="right">
+               <ul class="legend legend-set">
+               <li><strong>show</strong>
+                       <em><:= exists $get{show} ? 'flag images' : 'english names' :></em><:=
+                               !exists $get{show} && ' by default' :>
+               <li>default <strong>style</strong> is
+                       <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
+               </ul>
+       </div>
 </div>
 
 <p class="footer">