X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/58725794d72361cc70cb082476a32d08e22d21d0..85197963ca9cdece9448e6549d3759e65168d389:/mplayer.plp diff --git a/mplayer.plp b/mplayer.plp index f7b4445..30c72a9 100644 --- a/mplayer.plp +++ b/mplayer.plp @@ -1,17 +1,19 @@ <(common.inc.plp)><: -my $mode = $Request eq 'mpv' ? $Request : 'MPlayer'; -my $include = "\L$mode.eng"; +my $mode = lc($Request || 'mplayer'); +my $include = "$mode.eng"; + +my $info = eval { Data($include) } || {}; +$mode = $info->{title} // $mode; Html({ title => "\L$mode\E cheat sheet", - version => '1.2', + version => '1.3', description => [ "Keyboard cheat sheet for the $mode media player,", "overviewing the default controls." ], - keywords => [qw' - mpv mplayer mplayer2 media player video audio + keywords => [@{ $info->{keywords} // [] }, qw' sheet cheat reference overview control shortkey keyboard '], stylesheet => [qw( light dark circus mono red )], @@ -19,10 +21,15 @@ Html({ data => ["$include.inc.pl"], }); +%{$info} or Abort( + "Requested keyboard $mode not available", + '404 request not found', +); + say "

$mode cheat sheet

"; -say ''; +say "

$_

" for $info->{intro} // (); -use Shiar_Sheet::Keyboard 2; +use Shiar_Sheet::Keyboard 2.08; my $info = Data($include); my $keys = Shiar_Sheet::Keyboard->new($info); $keys->map($get{map}) or undef $get{map};