sc: prevent excess leading tbody tag
[sheet.git] / unicode.plp
index c22d19edf42804321735663862ba06c811ee4e31..c9f8ef190e7b70e7f15710e60006efc30d204d6b 100644 (file)
@@ -11,6 +11,7 @@ Html({
                unicode glyph char character reference common ipa symbol sign mark table digraph
        '],
        stylesheet => [qw'light dark red'],
+       data => [qw'digraphs.inc.pl'],
 });
 
 :>
@@ -28,19 +29,18 @@ i^k or i^vu respectively in <a href="/vi">Vim</a>.
 use Shiar_Sheet::FormatChar;
 my $glyphs = Shiar_Sheet::FormatChar->new;
 
-sub print_glyph_tables {
-       while (@_) {
-               printf '<div class="section"><h2>%s</h2>'."\n\n", shift;
-               while (ref $_[0] and $_ = shift) {
-                       print $glyphs->table($_);
-               }
-               print '</div>';
-       }
+if (exists $get{di}) {
+       $glyphs->{digraph} = defined $get{di} ? ! !$get{di} : 1;
+       $glyphs->{unicode} = 1;
+}
+if (exists $get{q}) {
+       $glyphs->{unicode} = -1;
+       $glyphs->{digraph}--;
 }
 
 our $verbose = exists $get{v};
 
-print_glyph_tables(
+$glyphs->print(
        'Popular',
        [qw{. « » . ‹ › . ‘ ’ . “ ” . „ ‚ . ‟ ‛}],
        [qw{. † ‡ • . § ¶ # . © ® ™ . ° ′ ″ . − × ÷ . ± ² √}],
@@ -56,8 +56,8 @@ print_glyph_tables(
                .>Türkçe    ç ğ ı İ ö ş ü
                .>Esperanto ĉ ĝ ĥ ĵ ŝ ŭ
        }] : (),
-       [qw{. ¿ … 〃 ‐ – . ‽ · ※ ‒ — }],
        [qw{. α β}],
+       [qw{. ¿ … 〃 ‐ – . ‽ · ※ ‒ — }],
 
        'Symbols',
        [qw{. ¤ ¢ ₥ € £ ₨ $ ¥ . ฿ ₫ ₭ ₦ ₱ ₮ ₩ ₪}],
@@ -212,10 +212,12 @@ $verbose ? (
 <div class="legend">
        <table class="glyphs"><tr>
        <td class="X di-a">ascii
-       <td class="X di-d">digraph
-       <td class="X di-prop">proposed
+       <td class="X di-d"><:= $glyphs->{digraph} ? 'digraph' : 'latin1' :>
+       <td class="X di-prop"><:= $glyphs->{digraph} ? 'proposed' : 'BMP' :>
        <td class="X di-b">other unicode
        <td class="X di-rare">discouraged
        </table>
 </div>
 
+<script type="text/javascript" src="/clipboard.js"></script>
+