mplayer: link mpv subpage, distinguish metadata
[sheet.git] / mplayer.plp
1 <(common.inc.plp)><:
2
3 my $mode = lc($Request || 'mplayer');
4 my $include = "$mode.eng";
5
6 my $info = eval { Data($include) } || {};
7 $mode = $info->{title} // $mode;
8
9 Html({
10         title => "\L$mode\E cheat sheet",
11         version => '1.3',
12         description => [
13                 "Keyboard cheat sheet for the $mode media player,",
14                 "overviewing the default controls."
15         ],
16         keywords => [@{ $info->{keywords} // [] }, qw'
17                 sheet cheat reference overview control shortkey keyboard
18         '],
19         stylesheet => [qw( light dark circus mono red )],
20         keys => 1,
21         data => ["$include.inc.pl"],
22 });
23
24 %{$info} or Abort(
25         "Requested keyboard <q>$mode</q> not available",
26         '404 request not found',
27 );
28
29 say "<h1>$mode cheat sheet</h1>";
30 say "<p>$_</p>" for $info->{intro} // ();
31
32 use Shiar_Sheet::Keyboard 2.08;
33 my $info = Data($include);
34 my $keys = Shiar_Sheet::Keyboard->new($info);
35 $keys->map($get{map}) or undef $get{map};
36 $keys->print_rows($get{rows}, [1,0]);
37 $keys->print_legends(\%get);
38