keyboard/altgr/index: label modes by description character.
[sheet.git] / keyboard / altgr / index.inc.plp
index 74c53dda0cf48a305bd58fc3a4707bc4943f9211..fd36e60d5cf1e3f8ff9c49bc7efdedcb47074dc9 100644 (file)
@@ -8,7 +8,7 @@ my $indexfile = "$dirbase/index";
 
 Html({
        title => "altgr keyboard cheat sheets",
-       version => '1.2',
+       version => '1.3',
        description => [
                "Overview of alternate keyboard modes,",
                "offering extended Unicode characters if a modifier key",
@@ -120,6 +120,7 @@ push @incs, @{ $idx->{$_} } for @{ $idx->{default} };
 
 my @sample = split /(?<!\+)/, $get{sample} // 'asSci1!+1';
 require Shiar_Sheet::Keyboard;
+Shiar_Sheet::Keyboard->VERSION(3.00);
 use List::Util qw( uniq max sum );
 
 my %caticon = (
@@ -156,7 +157,7 @@ for my $inc (@incs) {
                print '</a>', "\n\t";
                for my $mode ($table->{mode} ? sort keys %{ $table->{mode} } : '') {
                        print '<span class=graph>';
-                       printf '<label>%s</label>', s/\s.*//r for $table->{key}{$mode} || ();
+                       printf "<label>%s</label>", m/^(\S*)/ for $mode && $table->{mode}{$mode} || ();
                        for my $g (sort keys %{ $table->{inventory}{$mode} }) {
                                printf '<span class="%s" style="width:%.0f%%" title="%3$d %4$s"> %s</span>',
                                        $g, $_/$most*100, $_,
@@ -174,7 +175,7 @@ for my $inc (@incs) {
                        my $keydata = Data("$dirbase/$inc.eng");
                        Shiar_Sheet::Keyboard->new($keydata)
                }) {
-                       $keys->print_key('', $_, ($keys->{def}{''}{$_} // 'ni') =~ s/ mode\S*//r)
+                       $keys->print_key('', $_, ($keys->{def}{''}{$_} // ['ni']) =~ s/ mode\S*//r)
                                for @sample;
                }
                say '</tr>';