index: release v1.18 with only altgr index linked
[sheet.git] / apl.plp
diff --git a/apl.plp b/apl.plp
index 6fdf3ca62da5ba73a0eaccc2578234a5e10c6f41..302a55d5d0af890c5eb8328fb9bb1d5aeafdd50e 100644 (file)
--- a/apl.plp
+++ b/apl.plp
@@ -27,9 +27,7 @@ EOT
 
 use Shiar_Sheet::FormatChar;
 my $glyphs = Shiar_Sheet::FormatChar->new;
 
 use Shiar_Sheet::FormatChar;
 my $glyphs = Shiar_Sheet::FormatChar->new;
-
-my @ops = do 'apl.inc.pl';
-@ops > 1 or die "cannot open operator include: $@\n";
+my $ops = Data('apl');
 
 :>
 <h1>APL Symbols</h1>
 
 :>
 <h1>APL Symbols</h1>
@@ -49,9 +47,9 @@ my @ops = do 'apl.inc.pl';
 <tbody>
 
 <:
 <tbody>
 
 <:
-for my $op (@ops) {
+for my $op (@{$ops}) {
        $op or do {
        $op or do {
-               print "<tbody>\n";
+               say '<tbody>';
                next;
        };
 
                next;
        };
 
@@ -60,36 +58,26 @@ for my $op (@ops) {
        my $codepoint = ord $chr;
        my $ascii = $codepoint <= 127;
        my $info = $glyphs->glyph_info($codepoint);
        my $codepoint = ord $chr;
        my $ascii = $codepoint <= 127;
        my $info = $glyphs->glyph_info($codepoint);
-       my ($class, $name, $mnem, $html, $string) = @{$info};
+       my ($class, $name, $mnem, $entity, $string) = @{$info};
 
        printf '<tr><th title="%2$s">%s', $chr, EscapeHTML($name || '?'), $class;
        printf '<td class="%s">%s', @{$_} for (
                [$ascii ? 'l5' : defined $altkey ? 'l4' : 'l3', $altkey],
                [defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : $ascii ? 'l5' : 'l1',
                        EscapeHTML($mnem) // sprintf('%s%0*X', $codepoint < 256 ? (x => 2) : (u => 4), $codepoint)],
 
        printf '<tr><th title="%2$s">%s', $chr, EscapeHTML($name || '?'), $class;
        printf '<td class="%s">%s', @{$_} for (
                [$ascii ? 'l5' : defined $altkey ? 'l4' : 'l3', $altkey],
                [defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : $ascii ? 'l5' : 'l1',
                        EscapeHTML($mnem) // sprintf('%s%0*X', $codepoint < 256 ? (x => 2) : (u => 4), $codepoint)],
-               [defined $html ? 'l4' : $ascii ? 'l5' : 'l1', $html // "#$codepoint"],
+               [defined $entity ? 'l4' : $ascii ? 'l5' : 'l1', $entity // "#$codepoint"],
        );
        printf(
        );
        printf(
-               defined $_ ? '<td%s>%s' : '<td class=Xi>',
-               map { !!$_->[1] && qq( title="$_->[1]"), $_->[0] }
-               [map { EscapeHTML($_) } split /\n/, $_, 2]
+               '<td%s>%s',
+               map { defined ? (!!$_->[1] && qq( title="$_->[1]"), $_->[0]) : (' class=Xi', '') }
+               $_ && [map { EscapeHTML($_) } split /\n/, $_, 2]
        ) for $monad, $dyad;
        ) for $monad, $dyad;
-       print "</td>\n";
+       say '</td>';
 }
 
 :></table>
 </div>
 
 }
 
 :></table>
 </div>
 
-<hr>
-
-<div class="legend">
-       <table class="glyphs"><tr>
-       <td class="X l5">unicode 1.1
-       <td class="X l4">20th century
-       <td class="X l3">in 6.0 (2010)
-       <td class="X l2">recent assignments
-       <td class="X l1">proposed
-       <td class="ex">irregular
-       </table>
-</div>
+<:
+say for '<hr/>', $glyphs->legend;