From: Mischa POSLAWSKY Date: Sun, 26 Jun 2022 13:39:28 +0000 (+0200) Subject: map: generic page to show data tables X-Git-Tag: v1.14~56 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/49ffd5482382cad5c9eae0c73d2d11af5ea81b08 map: generic page to show data tables --- diff --git a/map.plp b/map.plp new file mode 100644 index 0000000..aa74c1c --- /dev/null +++ b/map.plp @@ -0,0 +1,29 @@ +<(common.inc.plp)><: +my $mapfile = sprintf 'map-%s.nld.tsv', $Request || 'numbers'; +open my $table, '<', $mapfile; +my ($title, $description) = split /\t/, readline $table; + +Html({ + title => $title, + version => '1.0', + data => [$mapfile], + description => $description, + raw => '', +}); + +say "

\u$title

"; +say "

$description

"; + +say ''; +while (my $row = readline $table) { + my @cols = split /\t/, $row; + @cols > 1 or last; + say '' if $. == 3; + print ''; + for (@cols) { + print /^\d / ? '
' : ''; + s/^.\K / /g; # icon glyph + print; + } +} +say '
';