perl: link version references in description
[sheet.git] / writing.plp
index c5a23c7f0eaf7f2f5da8e37bd5b920565006c503..82049fee1ad1853273f85426247793df9a07b1fc 100644 (file)
@@ -2,7 +2,7 @@
 
 Html({
        title => 'writing system inheritance sheet',
-       version => 'v1.0',
+       version => '1.3',
        description => [
                "Character comparison,",
                "tracking letters as they evolve from Phoenician to modern scripts.",
@@ -12,7 +12,7 @@ Html({
                script glyph unicode writing comparison character alphabet letter
                history phoenician latin sample test language multilingual
        '],
-       stylesheet => [qw'light circus dark red'],
+       stylesheet => [qw'light circus dark red mono'],
        data => [qw'writing-phnx.inc.pl'],
 });
 
@@ -35,20 +35,19 @@ unless (exists $get{v}) {
        $glyphs->{style} = 'univer';
 }
 
-my $scriptname = do 'writing-script.inc.pl';
-$_ = qq{<a href="/latin">$_</a>} for $scriptname->{latn} || ();
+my $scriptname = eval { Data('writing-script') }; # optional translations
+$_ = showlink($_, "/latin") for $scriptname->{latn} || ();
 
 for (
        [phnx => 'Phoenician'],
        [brah => 'Brahmi'],
 ) {
        my ($source, $title) = @$_;
-       my @table = do "writing-$source.inc.pl";
-       if ($! or $@) {
-               print "<h2>$title</h2>\n";
-               printf "<p>Table data not found: <em>%s</em>.</p>\n", $@ || $!;
+       my @table = eval { Data("writing-$source") } or do {
+               say "<h2>$title</h2>";
+               printf "<p>%s: <em>%s</em>.</p>\n", @{$@};
                next;
-       }
+       };
        $glyphs->print($title => [map {
                my $lead = s/^(-)// && $1;
                ref $_ eq 'ARRAY' ? @$_ : map { ".>$lead$_" }
@@ -56,18 +55,7 @@ for (
        } @table]);
 }
 
-:></div>
+say "</div>\n";
 
-<hr>
-
-<div class="legend">
-       <table class="glyphs"><tr>
-       <td class="X l5">unicode 1.1
-       <td class="X l4">20th century
-       <td class="X l3">in 6.0 (2010)
-       <td class="X l2">recent assignments
-       <td class="X l1">proposed
-       <td class="ex">irregular
-       </table>
-</div>
+say for '<hr/>', $glyphs->legend;