From: Mischa POSLAWSKY Date: Tue, 31 Oct 2023 19:30:22 +0000 (+0100) Subject: keyboard: generic subpage include, specifics in metadata X-Git-Tag: v1.15~13 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/fe3830a0e28e28ea18335cc81af2faac447fc69a keyboard: generic subpage include, specifics in metadata Extension of mplayer for compatibility with any layout. --- diff --git a/keyboard.eng.inc.pl b/keyboard.eng.inc.pl index df1d3f0..ff2d8e2 100644 --- a/keyboard.eng.inc.pl +++ b/keyboard.eng.inc.pl @@ -17,6 +17,16 @@ my @usint = ( ); { + title => 'keyboard', + version => '1.2', + description => [ + "Windows US international keyboard layout table", + "with the AltGr modifier key.", + ], + intro => 'Special characters returned with the AltGr modifier +for the Windows US international layout.', + rows => [0], + def => { '' => { map { diff --git a/keyboard.plp b/keyboard.plp index 8579524..36ccaca 100644 --- a/keyboard.plp +++ b/keyboard.plp @@ -1,32 +1,37 @@ <(common.inc.plp)><: -my $include = 'keyboard.eng'; -my $info = Data($include); +my $mode = lc($Request || 'keyboard'); +my $include = "$mode.eng"; + +my $info = eval { Data($include) } || {}; +$mode = $info->{title} // $mode; Html({ - title => 'keyboard cheat sheet', - version => '1.2', - description => [ - "Windows US international keyboard layout table", - "with the AltGr modifier key.", - ], + title => "\L$mode\E keyboard cheat sheet", + version => $info->{version} || '0.1', + description => $info->{description} // + ["Keyboard cheat sheet for the default controls of $mode."], + keywords => [@{ $info->{keywords} // [] }, qw' + sheet cheat reference overview keyboard control commands shortkey + '], stylesheet => [qw( light dark circus mono red )], keys => 1, data => ["$include.inc.pl"], }); -:> -

keyboard cheat sheet

- -

Special characters returned with the AltGr modifier -for the Windows US international layout.

+%{$info} or Abort( + "Requested keyboard $mode not available", + '404 request not found', +); -

normal mode (default)

+say "

$mode cheat sheet

"; +say "

$_

" for $info->{intro} // (); +say "

", $info->{mode}->{''}, " (default)

" + if $info->{mode} and %{ $info->{mode} } > 1; -<: use Shiar_Sheet::Keyboard 2.08; my $keys = Shiar_Sheet::Keyboard->new($info); $keys->map($get{map}) or undef $get{map}; -$keys->print_rows($get{rows}, [0]); +$keys->print_rows($get{rows}, $info->{rows}); $keys->print_legends(\%get);