browser: truncate maximum usage score to 99
[sheet.git] / digits.plp
index 10625a5cda0e3cc07f5b5563f5f5b4291d342584..a6a684e6ced5ba4d24d6539b990a8545c1adfcf8 100644 (file)
@@ -13,6 +13,11 @@ Html({
        )],
        stylesheet => [qw( light dark circus mono red )],
        data => [qw'writing-digits.inc.pl'],
+       raw => <<'EOT',
+<style>
+th:first-child { min-width: 10em }
+</style>
+EOT
 });
 
 :>
@@ -24,7 +29,7 @@ in various <a href="/writing">writing systems</a>.</p>
 <div>
 
 <:
-use Shiar_Sheet::FormatChar;
+use Shiar_Sheet::FormatChar 1.08;
 my $glyphs = Shiar_Sheet::FormatChar->new;
 unless (exists $get{v}) {
        $glyphs->{unicode}--;
@@ -33,17 +38,23 @@ unless (exists $get{v}) {
 }
 
 my $scriptname = do 'writing-script.inc.pl';
-$_ = qq{<a href="/latin">$_</a>} for $scriptname->{latn} || ();
+$_ = showlink($_, "/latin") for $scriptname->{latn} || ();
 
-my @table = do "writing-digits.inc.pl";
+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]);
+sub printtable {
+       say '<div class=section>', $glyphs->tabletag;
+       for my $id (@_) {
+               my $info = $table->{$id};
+               my $title = $info->{title} // $scriptname->{$id} || $id;
+               print $glyphs->row([ ".>$title", @{$info->{list}} ]);
+       }
+       say '</table></div>';
+}
 
-:></div>
+printtable(@{ $table->{$_} }) for @{ $table->{default} };
 
-<hr>
+say "</div>\n";
+say for '<hr/>', $glyphs->legend;