digits: split up table method to display rows
[sheet.git] / digits.plp
index 10625a5cda0e3cc07f5b5563f5f5b4291d342584..cfaa6eda42fbd3f8b1c916fe427a8e3f7134ed84 100644 (file)
@@ -24,7 +24,8 @@ in various <a href="/writing">writing systems</a>.</p>
 <div>
 
 <:
-use Shiar_Sheet::FormatChar;
+use List::Util qw( pairs );
+use Shiar_Sheet::FormatChar 1.08;
 my $glyphs = Shiar_Sheet::FormatChar->new;
 unless (exists $get{v}) {
        $glyphs->{unicode}--;
@@ -38,10 +39,13 @@ $_ = qq{<a href="/latin">$_</a>} for $scriptname->{latn} || ();
 my @table = do "writing-digits.inc.pl";
 die "Table data not found: $_\n" for $@ || $! || ();
 
-print $glyphs->table([map {
-       ref $_ eq 'ARRAY' ? @{$_} : map { ".>$_" }
-               $scriptname->{"digits_$_"} || $scriptname->{$_} || $_
-} @table]);
+say $glyphs->tabletag;
+for my $row (pairs @table) {
+       my ($id, $cols) = @{$row};
+       my $title = $scriptname->{"digits_$id"} || $scriptname->{$id} || $id;
+       print $glyphs->row([ ".>$title", @{$cols} ]);
+}
+say '</table>';
 
 :></div>