termcol: move generated xcolors include to data/
[sheet.git] / apl.plp
diff --git a/apl.plp b/apl.plp
index 804d80ea9c5c1813f9060cc6acc035aba858fba0..9ca99701ff2ff92f9f32176dbb1b12cdfeb24aef 100644 (file)
--- a/apl.plp
+++ b/apl.plp
@@ -2,13 +2,27 @@
 
 Html({
        title => 'APL',
-       version => 'v1.0',
+       version => '1.0',
        description => [
        ],
        keywords => [qw'
        '],
        stylesheet => [qw'light circus dark red'],
        data => [qw'apl.inc.pl'],
+       raw => <<'EOT',
+<style>
+       .target tbody td:nth-child(4) ~ td,
+       :target tbody td:nth-child(4) ~ td {
+               text-align: left;
+       }
+       .target tbody td[title]::after,
+       :target tbody td[title]::after {
+               content: ': ' attr(title);
+               font-size: 75%;
+               opacity: .7;
+       }
+</style>
+EOT
 });
 
 use Shiar_Sheet::FormatChar;
@@ -21,7 +35,7 @@ my @ops = do 'apl.inc.pl';
 <h1>APL Symbols</h1>
 
 <div class="section">
-<table class="mapped">
+<table class="mapped" onclick="this.classList.toggle('target')">
        <col><colgroup span=3><colgroup span=2>
 <thead><tr>
        <td rowspan=2>op
@@ -37,7 +51,7 @@ my @ops = do 'apl.inc.pl';
 <:
 for my $op (@ops) {
        $op or do {
-               print "<tbody>\n";
+               say '<tbody>';
                next;
        };
 
@@ -46,36 +60,26 @@ for my $op (@ops) {
        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)],
-               [defined $html ? 'l4' : $ascii ? 'l5' : 'l1', $html // "#$codepoint"],
+               [defined $entity ? 'l4' : $ascii ? 'l5' : 'l1', $entity // "#$codepoint"],
        );
        printf(
                defined $_ ? '<td%s>%s' : '<td class=Xi>',
                map { !!$_->[1] && qq( title="$_->[1]"), $_->[0] }
                [map { EscapeHTML($_) } split /\n/, $_, 2]
        ) for $monad, $dyad;
-       print "\n";
+       say '</td>';
 }
 
 :></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;