44adb74c0e0c722731583bab66422f5c65902df0
[sheet.git] / apl.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'APL',
5         version => 'v1.0',
6         description => [
7         ],
8         keywords => [qw'
9         '],
10         stylesheet => [qw'light circus dark red'],
11         data => [qw'apl.inc.pl'],
12 });
13
14 use Shiar_Sheet::FormatChar;
15 my $glyphs = Shiar_Sheet::FormatChar->new;
16
17 my @ops = do 'apl.inc.pl';
18 @ops > 1 or die "cannot open operator include: $@\n";
19
20 :>
21 <h1>APL Symbols</h1>
22
23 <div class="section">
24 <table class="mapped">
25 <thead><tr>
26         <td rowspan=2>op
27         <td colspan=3>input
28         <td colspan=2>meaning
29 <tr>
30         <td title="unified/Dyalog key combination">⎈
31         <td><a href="/digraphs" title="digraph">di</a><td>html
32         <td>monadic
33         <td>dyadic
34 </thead>
35
36
37 <:
38 for my $op (@ops) {
39         my ($chr, $monad, $dyad) = @{$op};
40         ($chr, my $altkey) = split /\n/, $chr;
41         my $codepoint = ord $chr;
42         my $ascii = $codepoint <= 127;
43         my $info = $glyphs->glyph_info($codepoint);
44         my ($class, $name, $mnem, $html, $string) = @{$info};
45
46         printf '<tr><th title="%2$s">%s'."\n", $chr, EscapeHTML($name || '?'), $class;
47         printf '<td class="%s">%s', @{$_} for (
48                 [$ascii ? 'l5' : defined $altkey ? 'l4' : 'l3', $altkey],
49                 [defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : $ascii ? 'l5' : 'l1',
50                         EscapeHTML($mnem) // sprintf('%s%0*X', $codepoint < 256 ? (x => 2) : (u => 4), $codepoint)],
51                 [defined $html ? 'l4' : $ascii ? 'l5' : 'l1', $html // "#$codepoint"],
52         );
53         printf(
54                 defined $_ ? '<td title="%2$s">%s' : '<td class="Xi">',
55                 map { EscapeHTML($_) } split /\n/, $_, 2
56         ) for $monad, $dyad;
57 }
58
59 :></table>
60 </div>
61
62 <hr>
63
64 <div class="legend">
65         <table class="glyphs"><tr>
66         <td class="X l5">unicode 1.1
67         <td class="X l4">20th century
68         <td class="X l3">in 6.0 (2010)
69         <td class="X l2">recent assignments
70         <td class="X l1">proposed
71         <td class="ex">irregular
72         </table>
73 </div>
74