1 <: # included from keyboard.plp
5 my @incs = glob 'keyboard/altgr/*.eng.inc.pl';
8 title => "altgr keyboard cheat sheets",
11 "Overview of alternate keyboard modes,",
12 "offering extended Unicode characters if a modifier key",
13 "(such as AltGr or option) is pressed.",
16 sheet cheat reference overview keyboard altgr option
18 image => 'data/keyboard/thumb/ibm-m.jpg',
19 stylesheet => [qw( light dark circus mono red )],
20 data => ['keyboard/altgr/index.inc.plp', @incs],
24 display: inline-table;
29 flex-direction: column;
30 justify-content: center;
38 vertical-align: middle;
45 <h1>Extended keyboards</h1>
47 <p>Available key layouts with AltGr or similar modifier keys.</p>
50 my @sample = split /(?<!\+)/, $get{sample} // 'asSci1!+1';
51 require Shiar_Sheet::Keyboard;
53 printf '<section class="%s">', @sample ? 'section' : 'gallery';
54 print '<dl>' if @sample;
55 my %idx = map {s/\Q.inc.pl\E$//; ($_ => eval{ Data($_) })} @incs;
57 $idx{$a}{category} cmp $idx{$b}{category} || $a cmp $b
59 print @sample ? '<dt>' : '<figure>';
60 printf '<a href="/%s">', $inc =~ s/\.eng$//r;
61 my $table = $idx{$inc};
62 my $title = $table && $table->{title} || $inc;
65 if ($table and my $img = $table->{image}) {
66 EscapeHTML $name = $table->{imagealt} // $img =~ m{.*/([^/.]*)};
67 print qq{<img src="/$img" alt="$name" />};
69 printf '<figcaption>%s</figcaption>', $title;
75 my $keys = Shiar_Sheet::Keyboard->new($table);
76 print join(' ', map { $keys->{key}{$_} =~ s/\s.*//r } grep {$_} keys %{$_})
77 for $keys->{mode} || ();
78 say '<dd><table class="keys big"><tr>';
79 $keys->print_key('', $_, $keys->{def}{''}{$_} // 'ni') for @sample;
80 print '</tr></table>';