latin: group aliases similar to termcol ea
[sheet.git] / latin.plp
index cac0e92b3fd7b07c756335a53a0e3519fad87c72..70c9b05ee8dd93a03d9c598a086975738506601d 100644 (file)
--- a/latin.plp
+++ b/latin.plp
@@ -48,28 +48,35 @@ Also see <a href="/writing">related alphabets</a>
 and <a href="/chars/abc">font comparison</a>.</p>
 
 <:
-use List::Util qw( pairs );
-
-my @table = Data('writing-latn');
+my $table = Data('writing-latn');
 {
        say '<div>';
        say '<style>';
-       for my $row (pairs @table) {
-               my ($id, $info) = @{$row};
+       while (my ($id, $info) = each %$table) {
+               ref $info eq 'HASH' or next;
                my $style = $info->{style} or next;
                ref $style or $style = [$style];
                say "\t", !/^@/ && "#$id ", $_ for @{$style};
        }
        say "</style>\n";
+}
 
-       my %VOWELCOLS = (map { ($_ => 1) } 0, 4, 8, 14, 20, 24);
-       say '<table class="glyphs">';
-       say '<thead><tr><th># <small>ASCII − 64</small>';
-       print '<td>', $_ for 1 .. 26;
-       say '</thead>';
+my %VOWELCOLS = (map { ($_ => 1) } 0, 4, 8, 14, 20, 24);
+say '<table class="glyphs">';
+say '<thead>';
+printtr('order');
+say '</thead>';
+printtr('default');
+say "</table></div>";
 
-       for my $row (pairs @table) {
-               my ($id, $info) = @{$row};
+sub printtr {
+       for my $id (@_) {
+               my $info = $table->{$id};
+
+               if (ref $info eq 'ARRAY') {
+                       printtr(@{$info});
+                       next;
+               }
 
                printf '<tr id="%s">', $id;
                my $th = 'th';
@@ -105,7 +112,6 @@ my @table = Data('writing-latn');
                        say;
                }
        }
-       say "</table></div>";
 }
 
 :>