From 1d4192ba208911f914e0c6fefaf9a15946d12c98 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 31 Oct 2023 19:54:08 +0100 Subject: [PATCH] mplayer: link mpv subpage, distinguish metadata --- mplayer.eng.inc.pl | 7 +++++++ mplayer.plp | 19 +++++++++++++------ mpv.eng.inc.pl | 7 +++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/mplayer.eng.inc.pl b/mplayer.eng.inc.pl index 930fe97..6c79fc9 100644 --- a/mplayer.eng.inc.pl +++ b/mplayer.eng.inc.pl @@ -1,6 +1,13 @@ use utf8; { +title => 'MPlayer', +intro => join("\n", + 'Default interface controls for the original MPlayer v1.0 media player.', + 'Mostly inherited by mpv.', +), +keywords => [qw'mpv mplayer mplayer2 media player video audio'], + key => { '[' => "slow down 10%", ']' => "speed up 10%", diff --git a/mplayer.plp b/mplayer.plp index 9e97d71..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,8 +21,13 @@ 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.08; my $info = Data($include); diff --git a/mpv.eng.inc.pl b/mpv.eng.inc.pl index 8047141..33c3a43 100644 --- a/mpv.eng.inc.pl +++ b/mpv.eng.inc.pl @@ -3,6 +3,13 @@ use utf8; my $legacy = do 'mplayer.eng.inc.pl' or die $@; { +title => 'mpv', +intro => join("\n", + 'Default interface controls for version 0.28 of the mpv media player.', + 'Differences from the original MPlayer are indicated.', +), +keywords => $legacy->{keywords}, + key => { %{ $legacy->{key} }, ',' => "step backward<>s", 'Q' => "save and quit", -- 2.30.0