X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/3a7275da51685956fb31799df6d8f625c0a4dd15..afb59e8b70e543ead8f26ab4701403404e4b15ea:/digraphs.plp?ds=sidebyside diff --git a/digraphs.plp b/digraphs.plp index 2b3446b..e5003b6 100644 --- a/digraphs.plp +++ b/digraphs.plp @@ -1,9 +1,11 @@ <(common.inc.plp)><: use 5.010; # state +my $mode = ($ENV{PATH_INFO} // '') eq '/xorg' || exists $get{xorg}; + Html({ title => 'digraph cheat sheet', - version => 'v1.0', + version => '1.1', description => [ "Complete table of digraph characters from RFC-1345.", ], @@ -32,6 +34,13 @@ are available as ex commands.

my $di = do 'digraphs.inc.pl' or die "Error loading digraphs data: ", $@ // $!; +if (exists $get{v}) { + # show characters for inverted mnemonics (vim alternatives) + $di->{ substr($_, 1, 1) . substr($_, 0, 1) } ||= + [ $di->{$_}->[0], '', 'l0 ex', '', $di->{$_}->[4] ] + for grep { ref $di->{$_} } keys %{$di}; +} + my @chars = ( [qw{! " % ' ( ) * + , - . /}], ['0'..'9'], [qw{: ; < = > ?}], @@ -42,7 +51,7 @@ my @chars2 = (['_'], @chars); # trailing character (extended set) my @columns = !exists $get{split} ? \@chars2 : ([@chars2[0, 1, 3, 4, 6]], [@chars2[2, 5, 7]]); -if (exists $get{xorg}) { +if ($mode) { my $xorg = do 'data/digraphs-xorg.inc.pl' or die "Error loading Xorg data: ", $@ // $!; $_ = [ord $_] for values %{$xorg}; @@ -117,7 +126,7 @@ print "\n"; print '
' if exists $get{split}; } -if (exists $get{xorg}) { +if ($mode) { :>