75c2cc382bced54cd0f6ea4061863ae65673099e
[sheet.git] / keyboard / altgr / index.inc.plp
1 <: # included from keyboard.plp
2 use 5.014;
3 use warnings;
4
5 my @incs = glob 'keyboard/altgr/*.eng.inc.pl';
6
7 Html({
8         title => "altgr keyboard cheat sheets",
9         version => '1.0',
10         description => [
11                 "Overview of alternate keyboard modes,",
12                 "offering extended Unicode characters if a modifier key",
13                 "(such as AltGr or option) is pressed.",
14         ],
15         keywords => [qw'
16                 sheet cheat reference overview keyboard altgr option
17         '],
18         stylesheet => [qw( light dark circus mono red )],
19         data => ['keyboard/altgr/index.inc.plp', @incs],
20         raw => <<'.',
21 <style>
22 img {
23         object-fit: cover;
24         height: 100%;
25 }
26 </style>
27 .
28 });
29
30 :>
31 <h1>Extended keyboards</h1>
32
33 <p>Representative images of available layouts
34 with AltGr or similar modifier keys.</p>
35
36 <section class="gallery"><:
37 for my $inc (@incs) {
38         $inc =~ s/\Q.inc.pl\E$//;
39         print '<figure>';
40         printf '<a href="/%s">', $inc =~ s/\.eng$//r;
41         if (my $table = eval { Data($inc) }) {
42                 if (my $img = $table->{image}) {
43                         EscapeHTML $name = $table->{imagealt} // $img =~ m{.*/([^/.]*)};
44                         print qq{<img src="/$img" alt="$name" />};
45                 }
46                 $inc = $table->{title};
47         }
48         printf '<figcaption>%s</figcaption>', $inc;
49         say '</a></figure>';
50 }
51 :></section>
52