git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyboard: generic subpage include, specifics in metadata
[sheet.git]
/
mplayer.plp
diff --git
a/mplayer.plp
b/mplayer.plp
index 8397498166d7fcb42ac8581d5ab97ceff344f438..30c72a9bab57434ccce535198eea80601059b4c0 100644
(file)
--- a/
mplayer.plp
+++ b/
mplayer.plp
@@
-1,29
+1,36
@@
<(common.inc.plp)><:
<(common.inc.plp)><:
-my $include = $Request eq 'mpv' ? $Request : 'mplayer';
+my $mode = lc($Request || 'mplayer');
+my $include = "$mode.eng";
+
+my $info = eval { Data($include) } || {};
+$mode = $info->{title} // $mode;
Html({
Html({
- title =>
'mplayer cheat sheet'
,
- version => '1.
1
',
+ title =>
"\L$mode\E cheat sheet"
,
+ version => '1.
3
',
description => [
description => [
- "Keyboard cheat sheet for the
MPlayer
media player,",
+ "Keyboard cheat sheet for the
$mode
media player,",
"overviewing the default controls."
],
"overviewing the default controls."
],
- keywords => [qw'
-
mplayer video media
sheet cheat reference overview control shortkey keyboard
+ keywords => [
@{ $info->{keywords} // [] },
qw'
+ sheet cheat reference overview control shortkey keyboard
'],
stylesheet => [qw( light dark circus mono red )],
keys => 1,
'],
stylesheet => [qw( light dark circus mono red )],
keys => 1,
+ data => ["$include.inc.pl"],
});
});
-:>
-<h1>MPlayer cheat sheet</h1>
+%{$info} or Abort(
+ "Requested keyboard <q>$mode</q> not available",
+ '404 request not found',
+);
-<h2>index (default)</h2>
+say "<h1>$mode cheat sheet</h1>";
+say "<p>$_</p>" for $info->{intro} // ();
-<:
-use Shiar_Sheet::Keyboard 2;
-my $info = do $include or die $@;
+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};
$keys->print_rows($get{rows}, [1,0]);
my $keys = Shiar_Sheet::Keyboard->new($info);
$keys->map($get{map}) or undef $get{map};
$keys->print_rows($get{rows}, [1,0]);