digraphs: link to and from altgr keyboards
[sheet.git] / keyboard / altgr / index.inc.plp
index fd36e60d5cf1e3f8ff9c49bc7efdedcb47074dc9..5491df8767567749cd506183615eff003fb35fbf 100644 (file)
@@ -111,7 +111,9 @@ img {
 :>
 <h1>Extended keyboards</h1>
 
-<p>Overview of available key layouts with AltGr or similar modifier keys.</p>
+<p>Overview of available key layouts with AltGr or similar modifier keys.
+Also see <a href="/digraphs">digraphs</a> for compose key combinations.
+</p>
 
 <:
 my $idx = Data($indexfile);
@@ -157,7 +159,8 @@ 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>", m/^(\S*)/ for $mode && $table->{mode}{$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, $_,
@@ -169,14 +172,19 @@ for my $inc (@incs) {
                        say '</span>';
                }
                print "\t<td class=ni>";
-               print join ' ', map { $caticon{$_} // () } split m{/}, $table->{category} // '';
+               print join ' ', map { $caticon{$_} // () }
+                       split m{/}, $table->{category} // '';
                say '';
                if (my $keys = eval {
                        my $keydata = Data("$dirbase/$inc.eng");
                        Shiar_Sheet::Keyboard->new($keydata)
                }) {
-                       $keys->print_key('', $_, ($keys->{def}{''}{$_} // ['ni']) =~ s/ mode\S*//r)
-                               for @sample;
+                       for my $c (@sample) {
+                               my $def = $keys->{def}{''}{$c} // [];
+                               $def->[0] //= 'ni';
+                               $def->[0] =~ s/ mode\S*//;
+                               $keys->print_key('', $c, $def);
+                       }
                }
                say '</tr>';
        }