digraphs: prefer xorg path over parameter
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 22 Mar 2017 18:51:12 +0000 (19:51 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 22 Mar 2017 21:28:04 +0000 (22:28 +0100)
Major subpage selector similar to other pages.

digraphs.plp

index 12f76c81e621562835120daff6ec383786151ebe..e5003b684e14aff99e2d75c0d41855c11b50daf8 100644 (file)
@@ -1,6 +1,8 @@
 <(common.inc.plp)><:
 use 5.010;  # state
 
 <(common.inc.plp)><:
 use 5.010;  # state
 
+my $mode = ($ENV{PATH_INFO} // '') eq '/xorg' || exists $get{xorg};
+
 Html({
        title => 'digraph cheat sheet',
        version => '1.1',
 Html({
        title => 'digraph cheat sheet',
        version => '1.1',
@@ -49,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]]);
 
 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};
        my $xorg = do 'data/digraphs-xorg.inc.pl'
                or die "Error loading Xorg data: ", $@ // $!;
        $_ = [ord $_] for values %{$xorg};
@@ -124,7 +126,7 @@ print "</table>\n";
 print '<hr>' if exists $get{split};
 }
 
 print '<hr>' if exists $get{split};
 }
 
-if (exists $get{xorg}) {
+if ($mode) {
 :>
 <div class="legend">
        <table class="glyphs"><tr>
 :>
 <div class="legend">
        <table class="glyphs"><tr>