index: release v1.18 with only altgr index linked
[sheet.git] / map.plp
1 <(common.inc.plp)><:
2 my $mapfile = sprintf 'map-%s.nld.tsv', $Request || 'numbers';
3 open my $table, '<', $mapfile;
4 my ($title, $description) = split /\t/, readline $table;
5
6 Html({
7         title => $title,
8         version => '1.0',
9         data => [$mapfile],
10         description => $description,
11         raw => '<style>td,th{text-align:left}</style>',
12 });
13
14 say "<h1>\u$title</h1>";
15 say "<p>$description</p>";
16
17 say '<table><thead>';
18 while (my $row = readline $table) {
19         my @cols = split /\t/, $row;
20         @cols > 1 or last;
21         say '<tbody>' if $. == 3;
22         print '<tr>';
23         for (@cols) {
24                 print /^\d / ? '<th>' : '<td>';
25                 s/^.\K /&nbsp;/g; # icon glyph
26                 print;
27         }
28 }
29 say '</table>';