From 4cccd0f03b54ed366c5de96fb40cea688c6482e9 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 13 Sep 2008 08:06:28 +0000 Subject: [PATCH] digraphs: css update, cell groups Add table groups (major borders) bringing a bit more structure to the sea of 6400 cells. A couple of other css-related changes. --- digraphs.css | 15 +++++++++++++- digraphs.plp | 58 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/digraphs.css b/digraphs.css index 3e53004..4fa8f7c 100644 --- a/digraphs.css +++ b/digraphs.css @@ -21,7 +21,7 @@ h1 { font-size: 200%; margin: 0 0 0.2em; } -p.footer { +p#footer { margin: 1em 0 0; text-align: center; } @@ -32,6 +32,16 @@ table { border-collapse: collapse; table-layout: fixed; /* prevent resizing, notably in msie6 */ } +tbody, colgroup { + border: 2px double #888; +} +tbody { + border-width: 2px 0; +} +colgroup { + border-width: 0 2px; +} + #legend { margin-top: 1em; } @@ -39,6 +49,9 @@ table { width: 100%; table-layout: auto; } +#legend tbody { + border: 0; +} #legend td { padding: 0 0.2em; } diff --git a/digraphs.plp b/digraphs.plp index 6e8a30a..b62b577 100644 --- a/digraphs.plp +++ b/digraphs.plp @@ -32,38 +32,46 @@ sub quote { return $_; } -my @chars = ((map {chr} ord '!' .. ord 'Z'), 'a'..'z'); -splice @chars, $_, 1, () for 2, 3-1, 5-2, 31-3; # remove character exceptions # $ & @ -my @chars2 = (@chars, '_'); # trailing character (extended set) +my @chars = ( + [qw{! " % ' ( ) * + , - . /}], + ['0'..'9'], [qw{: ; < = > ?}], + ['A'..'M'], ['N'..'Z'], + ['a'..'m'], ['n'..'z'], +); +my @chars2 = (@chars, ['_']); # trailing character (extended set) -print ''; +print '
'; +print qq'' for map {scalar @$_} @chars2; +print "\n"; for my $section (qw{thead tfoot}) { print "<$section>'; -for my $c1 (@chars) { - print "'; + for my $c1 (@$c1group) { + print "
 "; - print "$_" for @chars2; + print "$_" for map {@$_} @chars2; } -print '
$c1"; - for my $c2 (@chars2) { - my $mnem = $c1 . $c2; - if (not defined $di->{$mnem}) { - print ''; - next; - } - my ($codepoint, $name, $prop, $script) = @{ $di->{$mnem} }; +for my $c1group (@chars) { + print '
$c1"; + for my $c2 (map {@$_} @chars2) { + my $mnem = $c1 . $c2; + if (not defined $di->{$mnem}) { + print ''; + next; + } + my ($codepoint, $name, $prop, $script) = @{ $di->{$mnem} }; - my $glyph = chr $codepoint; - utf8::upgrade($glyph); # prevent latin1 output - my $desc = $mnem . ($name && " ($name)"); - my @class = ('X', grep {$_} $prop, $script); + my $glyph = chr $codepoint; + utf8::upgrade($glyph); # prevent latin1 output + my $desc = $mnem . ($name && " ($name)"); + my @class = ('X', grep {$_} $prop, $script); - $glyph = quote($glyph); - $glyph = "$glyph" if $prop eq 'Zs'; + $glyph = quote($glyph); + $glyph = "$glyph" if $prop eq 'Zs'; - printf "\n".'%s', - join(' ', @class), quote($desc), $glyph; + printf "\n".'%s', + join(' ', @class), quote($desc), $glyph; + } + print "\n$c1\n"; } - print "\n$c1\n"; } print "
\n"; :> @@ -97,7 +105,7 @@ print "\n"; -