index: release v1.18 with only altgr index linked
[sheet.git] / cli.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'cli cheat sheet',
5         version => '1.0',
6         description => [],
7         keywords => [qw'
8         '],
9         data => ['data/cli.inc.pl'],
10 });
11
12 my $cmd = Data('data/cli');
13 :>
14 <h1>CLI options</h1>
15
16 <style>
17         tbody td {font-size:70%}
18 </style>
19 <:
20 sub showoption {
21         my ($info, $char, $span) = @_;
22         my ($alias, $help) = @{ $info // [] };
23         printf '<td class="l%s"', $info ? 5 : 1;
24         print ' rowspan="2"' if $span;
25         print '>';
26         $info or return;
27         my ($title) = $alias =~ m{--([\w-]+=?)}
28                 or return print $char;
29         $title =~ s/-\K/<wbr>/g;
30         $title =~ s/deref\Kerence/./;
31         print $title;
32 }
33
34 my @colchars = ('a'..'z', '?');
35 print '<table class="ccmap"><col>';
36 print qq'<colgroup span="$_">' for scalar @colchars;
37 #say '</colgroup><col>';
38 for my $section (qw{thead tfoot}) {
39         print "<$section><tr><th>↳";
40         print '<th>', EscapeHTML($_) for @colchars;
41         say '';
42 }
43 print '<tbody>';
44 for my $name (sort keys %$cmd) {
45         my $row = $cmd->{$name};
46         print '<tr><th rowspan="2">', $name;
47         showoption($row->{$_}, $_, !$row->{uc $_}) for @colchars;
48         print "\n\t<tr>";
49         $row->{$_} and showoption($row->{$_}, $_) for map {uc} @colchars;
50 }
51 say '</table>';
52 :>
53
54 <div class="legend">
55         <table class="glyphs"><tr>
56         <td class="X l5">supported
57         <td class="X l1">unsupported
58         <td class="X l0 ex">alias
59         </table>
60 </div>