3 my $mode = lc($Request || 'altgr');
4 my $include = "$mode.eng";
6 my $info = eval { Data($include) } || {};
7 warn "error in $include: ", @{$@} if ref $@;
8 $mode = $info->{title} // $mode;
11 title => "\L$mode\E keyboard cheat sheet",
12 version => $info->{version} || '0.1',
13 description => $info->{description} //
14 ["Keyboard cheat sheet for the default controls of $mode."],
15 keywords => [@{ $info->{keywords} // [] }, qw'
16 sheet cheat reference overview keyboard control commands shortkey
18 stylesheet => [qw( light dark circus mono red )],
20 data => ["$include.inc.pl"],
24 "Requested keyboard <q>$mode</q> not available",
25 '404 request not found',
28 say "<h1>$mode cheat sheet</h1>";
29 say "<p>$_</p>" for $info->{intro} // ();
30 say "<h2>", $info->{mode}->{''}, " (default)</h2>"
31 if $info->{mode} and %{ $info->{mode} } > 1;
33 use Shiar_Sheet::Keyboard 2.08;
34 my $keys = Shiar_Sheet::Keyboard->new($info);
35 $keys->map($get{map}) or undef $get{map};
36 $keys->print_rows($get{rows}, $info->{rows});
37 $keys->print_legends(\%get);