digraphs: ?split option to distribute columns over multiple tables
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 22 Feb 2015 01:04:28 +0000 (02:04 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Jun 2015 03:43:42 +0000 (05:43 +0200)
digraphs.plp

index a78a90c043d72c2d811aa742f2e5f8983408277a..3073f9a4d1b0487539b3dbb187b1e788e22747ca 100644 (file)
@@ -32,20 +32,23 @@ my @chars = (
        ['a'..'m'], ['n'..'z'],
 );
 my @chars2 = (['_'], @chars);  # trailing character (extended set)
+my @columns = !exists $get{split} ? \@chars2 :
+       ([@chars2[0, 1, 3, 4, 6]], [@chars2[2, 5, 7]]);
 
+for my $colchars (@columns) {
 print '<table class="glyphs dimap"><col>';
-print qq'<colgroup span="$_">' for map {scalar @$_} @chars2;
+print qq'<colgroup span="$_">' for map {scalar @$_} @{$colchars};
 print "</colgroup><col>\n";
 for my $section (qw{thead tfoot}) {
        print "<$section><tr><th>↳";
-       print '<th>', EscapeHTML($_) for map {@$_} @chars2;
+       print '<th>', EscapeHTML($_) for map {@$_} @{$colchars};
        print "<th>&nbsp;\n";
 }
 for my $c1group (@chars) {
        print '<tbody>';
        for my $c1 (@$c1group) {
                print '<tr><th>', EscapeHTML($c1);
-               for my $c2 (map {@$_} @chars2) {
+               for my $c2 (map {@$_} @$colchars) {
                        my $mnem = $c1 . $c2;
                        if (not defined $di->{$mnem}) {
                                print '<td>';
@@ -72,6 +75,8 @@ for my $c1group (@chars) {
        }
 }
 print "</table>\n";
+print '<hr>' if exists $get{split};
+}
 :>
 <div class="legend">
        <table class="glyphs"><tr>