style: generic naming scheme for support classes
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 11 Nov 2010 21:42:52 +0000 (22:42 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 10 Nov 2010 21:40:55 +0000 (22:40 +0100)
Rename specific di-* digraph identifiers to basic support classes l?.
Remaining di-* classes mostly become generic unicode character markers u-*.

Shiar_Sheet/FormatChar.pm
base.css
browser.plp
charset-utf8.inc.pl
circus.css
dark.css
darklite.css
red.css
unicode.plp

index a806258..c123506 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use Data::Dump 'pp';
 use PLP::Functions 'EscapeHTML';
 
-our $VERSION = '1.03';
+our $VERSION = '1.04';
 
 our $diinfo = do 'digraphs.inc.pl';
 our %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} }
@@ -71,39 +71,39 @@ sub cell {
                $cell = '';
        }
        elsif ($input eq '=') {
-               push @class, 'di-invalid';
+               push @class, 'u-invalid';
                $cell = '';
        }
        else {
                push @class, 'X';
 
                if ($input =~ s/^-//) {
-                       push @class, 'di-rare'; # discouraged
+                       push @class, 'ex'; # discouraged
                }
 
                ($cell, $title, my $class, $mnem) = $self->glyphs_html($input);
 
                if ($self->{digraph}) {
                        if (defined $mnem) {
-                               push @class, 'di-d'; # digraph
-                               push @class, 'di-prop' if $class =~ /\bXz\b/; # unofficial
+                               push @class, $class =~ /\bXz\b/ ? ('l2', 'u-prop') # unofficial
+                                       : ('l4', 'u-di'); # standard digraph
                        }
                }
                else {
                        my $codepoint = ord(substr $input, 0, 1);
                        if ($codepoint <= 0xFF) {
-                               push @class, 'di-d';  # latin1
+                               push @class, 'l4', 'u-lat1';  # latin1
                        }
                        elsif ($codepoint <= 0xD7FF) {
-                               push @class, 'di-prop';  # bmp
+                               push @class, 'l2', 'u-bmp';  # bmp
                        }
                }
 
                if ($input =~ /[ -~]/) {
-                       push @class, 'di-a'; # ascii
+                       push @class, 'l5', 'u-ascii'; # ascii
                }
                else {
-                       push @class, 'di-b'; # basic unicode
+                       push @class, 'l0'; # basic unicode
                }
        }
 
index ededb55..d4e3758 100644 (file)
--- a/base.css
+++ b/base.css
@@ -322,14 +322,17 @@ td.Xr                      {color: #888} /* reserved (digraph reverse or proposa
 .dimap td.Xr               {background: #EEE} /* reversed digraph */
 .ccmap td.Xr {opacity:.4}
 
-/* implementation-based alternatives */
-td.di-b       {background: #FDD} /* bmp */
-td.di-d       {background: #FFD} /* rfc-1345 digraph */
-td.di-prop    {background: #FED} /* proposed digraph */
-td.di-a       {background: #EFD} /* ascii */
-td.di-aa      {background: #DFD} /* ascii */
-td.di-rare    {background: #EEE} /* disfavoured */
-td.di-invalid {background: #BBB} /* impossible */
+/* support levels */
+td.l0 {background: #FDD} /* no, unsupported, other */
+td.l2 {background: #FED} /* partial, restricted, unofficial */
+       /* default u-prop, u-bmp */
+td.l4 {background: #FFD} /* almost, imperfect, common */
+       /* default u-di, u-lat1 */
+td.l5 {background: #EFD} /* yes, supported, ubiquitous, native */
+       /* default u-ascii */
+td.l6 {background: #DFD} /* complete, perfect */
+td.ex {background: #EEE} /* experimental, disfavoured */
+td.u-invalid {background: #BBB} /* invalid, impossible */
 
 /* code syntax */
 .sy-comment    { color: #888 }
@@ -343,7 +346,7 @@ td.di-invalid {background: #BBB} /* impossible */
 .sy-todo       { background-color: #FF0 }
 
 /* hover effects */
-td.di-d,
+td.u-di,
 td.X:hover {cursor: help}
 td.Greek:hover, td.Armenian:hover                  {background: #FA8}
 td.Cyrillic:hover                                  {background: #FB7}
@@ -374,12 +377,12 @@ td.Xr:hover                                        {background: #FFF} /* reserve
 td.Xa:hover {outline: 1px solid #0F0} /* ascii */
 td.Xl:hover {outline: 1px solid #0C0} /* latin1 */
 td.Xz:hover {outline: 1px solid #F00} /* proposed */
-td.di-rare:hover                                   {background: #BBB}
-td.di-b:hover                                      {background: #F88}
-td.di-d:hover                                      {background: #FF8}
-td.di-prop:hover                                   {background: #FC8}
-td.di-a:hover                                      {background: #CF8}
-td.di-aa:hover                                     {background: #8F8}
+td.l0:hover                                        {background: #F88}
+td.l2:hover                                        {background: #FC8}
+td.l4:hover                                        {background: #FF8}
+td.l5:hover                                        {background: #CF8}
+td.l6:hover                                        {background: #8F8}
+td.ex:hover                                        {background: #BBB}
 
 /* key type colorization */
 
index b82f5fb..29002d0 100644 (file)
@@ -24,22 +24,22 @@ browser usage statistics.</p>
 my $caniuse = do 'browser-support.inc.pl' or die $! || $@;
 
 my %CSTATS = (
-       n => 'di-b',
-       y => 'di-aa',
-       a     => 'di-d',
-       'a x' => 'di-d',
-       j     => 'di-prop',
-       p     => 'di-prop',
-       'p j' => 'di-prop',
-       'y x' => 'di-a',
+       'n'   => 'l0',
+       'y'   => 'l6',
+       'y x' => 'l5',
+       'a'   => 'l4',
+       'a x' => 'l4',
+       'p j' => 'l2',
+       'j'   => 'l2',
+       'p'   => 'l2',
 );
 my %CSTATUS = (
-       unoff => 'di-rare', # unofficial
-       wd    => 'di-b', # draft
-       pr    => 'di-prop', # proposed
-       cr    => 'di-d', # candidate
-       rec   => 'di-a', # recommendation
-       ietf  => 'di-aa', # standard
+       unoff => 'ex', # unofficial
+       wd    => 'l0', # draft
+       pr    => 'l2', # proposed
+       cr    => 'l4', # candidate
+       rec   => 'l5', # recommendation
+       ietf  => 'l6', # standard
 );
 my @browsers = qw(trident gecko webkit_saf webkit_chr presto);
 my %versions;
@@ -199,11 +199,11 @@ alert(t);
 
 <div class="legend">
        <table class="glyphs"><tr>
-       <td class="X di-aa">supported
-       <td class="X di-a">prefixed
-       <td class="X di-d">partial
-       <td class="X di-prop">external (js/plugin)
-       <td class="X di-b">missing
+       <td class="X l6">supported
+       <td class="X l5">prefixed
+       <td class="X l4">partial
+       <td class="X l2">external (js/plugin)
+       <td class="X l0">missing
        </table>
 
        <div class="right">
index c751e6d..0edd2e7 100644 (file)
@@ -1,23 +1,23 @@
 my %utf8byte = (
-       0x00, '<td rowspan="8" colspan="16" class="X di-a"'.
+       0x00, '<td rowspan="8" colspan="16" class="X l5 u-ascii"'.
                          ' title="U+0000 – U+007F">single byte ASCII',
-       0x80, '<td rowspan="4" colspan="16" class="X di-d"'.
+       0x80, '<td rowspan="4" colspan="16" class="X l4"'.
                          '>multi-byte continuation',
-       0xC0, '<td colspan="2" class="X di-b" style="border-right:none; border-bottom:none"'.
+       0xC0, '<td colspan="2" class="X l0" style="border-right:none; border-bottom:none"'.
                          ' title="U+0000 – U+007F">(overl.)',
-       0xC2, '<td rowspan="2" colspan="14" class="X di-prop" style="border-left:none"'.
+       0xC2, '<td rowspan="2" colspan="14" class="X l2 u-bmp" style="border-left:none"'.
                          ' title="U+0080 – U+03FF">2-byte sequence start',
-       0xD0, '<td rowspan="1" colspan="16" class="X di-prop" style="border-top:none"'.
+       0xD0, '<td rowspan="1" colspan="16" class="X l2 u-bmp" style="border-top:none"'.
                          ' title="U+0400 – U+07FF">',
-       0xE0, '<td colspan="16" class="X di-prop"'.
+       0xE0, '<td colspan="16" class="X l2 u-bmp"'.
                          ' title="U+0800 – U+FFFF">3-byte sequence start',
-       0xF0, '<td colspan="5" class="X di-prop" style="border-right:none"'.
+       0xF0, '<td colspan="5" class="X l2" style="border-right:none"'.
                          ' title="U+1·0000 – U+10·FFFF">4-byte sequence',
-       0xF5, '<td colspan="3" class="X di-b" style="border-left:none"'.
+       0xF5, '<td colspan="3" class="X l0" style="border-left:none"'.
                          ' title="U+11·0000 – U+1FF·FFFF">(overflow)',
-       0xF8, '<td colspan="4" class="X di-b"'.
+       0xF8, '<td colspan="4" class="X l0"'.
                          ' title="U+200·0000 – U+3FFF·FFFF">5-byte',
-       0xFC, '<td colspan="2" class="X di-b"'.
+       0xFC, '<td colspan="2" class="X l0"'.
                          ' title="U+4000·0000 – 7FFFF·FFFF">6-byte',
        0xFE, '<td colspan="2" class="di-invalid">invalid',
 );
index 6e94e3b..95a7485 100644 (file)
@@ -1,16 +1,16 @@
 @import url(base.css);
 @import url(terse.css) all and (max-width: 80em);
 
-td.di-b          {background: #F77} /* bmp */
-td.di-b:hover    {     color: #F77; background: #000}
-td.di-d          {background: #FF6} /* rfc-1345 digraph */
-td.di-d:hover    {     color: #FF6; background: #000}
-td.di-prop       {background: #FC6} /* proposed digraph */
-td.di-prop:hover {     color: #FC6; background: #000}
-td.di-a          {background: #CF8} /* ascii */
-td.di-a:hover    {     color: #CF8; background: #000}
-td.di-aa         {background: #8F8}
-td.di-aa:hover   {     color: #8F8; background: #000}
+td.l0       {background: #F77}
+td.l0:hover {     color: #F77; background: #000}
+td.l2       {background: #FC6}
+td.l2:hover {     color: #FC6; background: #000}
+td.l4       {background: #FF6}
+td.l4:hover {     color: #FF6; background: #000}
+td.l5       {background: #CF8}
+td.l5:hover {     color: #CF8; background: #000}
+td.l6       {background: #8F8}
+td.l6:hover {     color: #8F8; background: #000}
 
 td.Co                      {background: #DBB} /* private */
 td.c-na,
index b581104..8c06973 100644 (file)
--- a/dark.css
+++ b/dark.css
@@ -55,13 +55,13 @@ td.Xr {background: #111} /* reverse */
 td.Co {background: #322} /* private */
 
 /* implementation-based alternatives */
-td.di-b       {background: #411} /* bmp */
-td.di-d       {background: #330} /* rfc-1345 digraph */
-td.di-prop    {background: #321} /* proposed digraph */
-td.di-a       {background: #030} /* ascii */
-td.di-aa      {background: #00331D} /* ascii */
-td.di-rare    {background: #222} /* disfavoured */
-td.di-invalid {background: #333} /* impossible */
+td.l0 {background: #411} /* bmp */
+td.l2 {background: #321} /* proposed digraph */
+td.l4 {background: #330} /* rfc-1345 digraph */
+td.l5 {background: #030} /* ascii */
+td.l6 {background: #00331D} /* ascii */
+td.ex {background: #222} /* disfavoured */
+td.u-invalid {background: #333} /* impossible */
 
 /* general colorization */
 
index 41c915e..4c33f0a 100644 (file)
@@ -23,16 +23,16 @@ td.X  {background: #000} /* unidentified */
 td.Xr {background: #111} /* reverse */
 td.Co {background: #181111} /* private */
 
-.mo, td.c-as, td.di-b       {background: #200}
-.co, td.c-af, td.di-d       {background: #1C1C00}
-.cp, td.c-eu, td.di-prop    {background: #221400}
-.pm, td.c-na, td.di-a       {background: #002200}
-.po                         {}
-.ci, td.c-sa                {background: #001A1A}
-.mi                         {}
-.mv, td.c-oc                {background: #012}
-.me, td.c-aa                {background: #102}
-.no                         {}
-              td.di-rare    {background: #181818} /* disfavoured */
-              td.di-invalid {background: #222} /* impossible */
+.mo, td.c-as, td.l0 {background: #200}
+.co, td.c-af, td.l4 {background: #1C1C00}
+.cp, td.c-eu, td.l2 {background: #221400}
+.pm, td.c-na, td.l5 {background: #002200}
+.po                 {}
+.ci, td.c-sa        {background: #001A1A}
+.mi                 {}
+.mv, td.c-oc        {background: #012}
+.me, td.c-aa        {background: #102}
+.no                 {}
+              td.ex {background: #181818}
+td.u-invalid        {background: #222}
 
diff --git a/red.css b/red.css
index e953f5b..373fe76 100644 (file)
--- a/red.css
+++ b/red.css
@@ -80,7 +80,7 @@ dt.pm, dt.mv,
        color: #FF0;
 } /* mode link */
 
-td.di-b,
+td.l0,
 td.X { /* unidentified */
        background: #000;
        border-color: #800;
@@ -109,12 +109,12 @@ tbody, colgroup, th {
 }
 
 /* implementation-based alternatives */
-td.di-b       {background: #000; color: #DD6} /* bmp */
-td.di-d       {background: #000; color: #CCC} /* rfc-1345 digraph */
-td.di-prop    {background: #000; color: #CA8} /* proposed digraph */
-td.di-a       {background: #000; color: #8BC} /* ascii */
-td.di-rare    {background: #333} /* disfavoured */
-td.di-invalid {background: #200} /* impossible */
+td.l0 {background: #000; color: #DD6}
+td.l4 {background: #000; color: #CCC}
+td.l2 {background: #000; color: #CA8}
+td.l5 {background: #000; color: #8BC}
+td.ex {background: #333}
+td.u-invalid {background: #200} /* impossible */
 
 /* continents */
 td.c-af       {background: #100; color: #FFF}
@@ -124,7 +124,7 @@ td.c-aa       {background: #400; color: #8BC}
 td.c-oc       {background: #100; color: #8BC}
 td.c-sa       {background: #100; color: #DD6}
 td.c-na       {background: #300; color: #DD6}
-td.di-b:hover,
+td.l0:hover,
 td.X:hover    {background: #800; color: #FF0}
 
 /* code syntax */
index c9f8ef1..70f13e6 100644 (file)
@@ -211,11 +211,11 @@ $verbose ? (
 
 <div class="legend">
        <table class="glyphs"><tr>
-       <td class="X di-a">ascii
-       <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
+       <td class="X l5">ascii
+       <td class="X l4"><:= $glyphs->{digraph} ? 'digraph' : 'latin1' :>
+       <td class="X l2"><:= $glyphs->{digraph} ? 'proposed' : 'BMP' :>
+       <td class="X l0">other unicode
+       <td class="X ex">discouraged
        </table>
 </div>