X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/85197963ca9cdece9448e6549d3759e65168d389..26a71f36c68773b18095911e99be7294cbd66f39:/keyboard.plp diff --git a/keyboard.plp b/keyboard.plp index 8579524..4a49ebb 100644 --- a/keyboard.plp +++ b/keyboard.plp @@ -1,32 +1,76 @@ <(common.inc.plp)><: -my $include = 'keyboard.eng'; -my $info = Data($include); +my $mode = lc($Request || 'altgr'); +my $include = "$mode.eng"; + +my $info = eval { Data($include) } || {}; +warn "error in $include: ", @{$@} if ref $@; +$mode = $info->{title} // $mode; + +my $showkeys //= !exists $get{keys} ? undef : + ($get{keys} ne '0' && ($get{keys} || 'always')); +my @keystyle = ( + '', + '', + !$showkeys ? '' : + $showkeys eq 'ghost' ? '' : (), + '', +); 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"], + raw => \@keystyle, }); -:> -
Special characters returned with the AltGr modifier -for the Windows US international layout.
+%{$info} or Abort( + "Requested keyboard$modenot available", + '404 request not found', +); -
$_
" for $info->{intro} // (); +say "