writing: bramic section as separate subpage
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 3 Apr 2017 11:38:14 +0000 (13:38 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 19 Dec 2023 23:50:26 +0000 (00:50 +0100)
writing-brah.inc.pl
writing-phnx.inc.pl
writing.plp

index 7a4ac8af64cc44ab34f4715ca54edd7b2502b6c9..913716fb6634b081d46142e5e9cdf25a12b8fe56 100644 (file)
@@ -1,5 +1,15 @@
 use utf8;
 {
+title => 'brahmic',
+pagetitle => 'brahmic scripts comparison sheet',
+version => '1.0',
+keywords => [qw( brahmic brahmi abugida )],
+intro => <<'.',
+Comparison of writing systems derived from the ancient Brahmi abugida.
+Also see more distant relatives of <a href="/writing">Phoenician</a>,
+including the <a href="/latin">Latin</a> alphabet.
+See <a href="/charset">charsets</a> for other characters.
+.
 list => [qw(
        iso ipa
        orya beng deva gujr guru tibt sidd
index 33ff5880b68b864d35f9d69a73d7123f8f509aea..e16f8da85b6e40adcdb579257afd9ee39ffc0446 100644 (file)
@@ -1,5 +1,25 @@
 use utf8;
 {
+title => 'phoenician-derived',
+pagetitle => 'writing system inheritance sheet',
+version => '1.3',
+keywords => [qw'
+       phoenician proto-canaanite hebrew latin greek aramaic arabic
+       abjad related derived descendant
+'],
+description => [
+       "Character comparison,",
+       "tracking letters as they evolve from Phoenician to modern scripts.",
+       "Good Unicode test sample.",
+],
+intro => <<'.',
+Comparison of Unicode letters in related alphabets.
+There are more detailed pages of <a href="/latin">Latin</a>
+and <a href="/writing/brahmi">Brahmic</a> scripts.
+Also see <a href="/charset">charsets</a>
+and <a href="/unicode">common characters</a>.
+.
+
 list => [qw(
        latn -runr -ital -goth -copt cyrl -perm -lyci grek -cari -lydi
        phnx -egyp -samr -armi hebr -sarb ethi -narb -nbat arab
index 2c67ae058fc7ac5384884ad821b40d26f57b28c6..a12c1f94c540ee5a411af718e02433cb6233931d 100644 (file)
@@ -1,32 +1,32 @@
 <(common.inc.plp)><:
 
+my $source = lc $Request || 'phnx';
+$source =~ s/^brah\Kmi$//;
+my $include = "writing-$source";
+
+my $info = eval { Data($include) } || {};
+
 Html({
-       title => 'writing system inheritance sheet',
-       version => '1.3',
-       description => [
-               "Character comparison,",
-               "tracking letters as they evolve from Phoenician to modern scripts.",
-               "Good Unicode test sample.",
-       ],
-       keywords => [qw'
-               script glyph unicode writing comparison character alphabet letter
-               history phoenician latin sample test language multilingual
-       '],
+       title => $info->{pagetitle} || "$info->{title} scripts comparison sheet",
+       version => $info->{version} || '0.1',
+       description => $info->{description},
+       keywords => [@{ $info->{keywords} // []}, qw(
+               writing script glyph unicode character letter comparison history
+               alphabet sample test language multilingual
+       )],
        stylesheet => [qw'light circus dark red mono'],
-       data => [qw'writing-phnx.inc.pl'],
+       data => ["$include.inc.pl"],
 });
 
-:>
-<h1>Writing systems</h1>
+my $rows = $info->{list} or Abort(
+       "Requested script parent <q>$source</q> not available",
+       '404 request not found',
+);
 
-<p>
-Comparison of Unicode letters in related alphabets.
-Also see <a href="/charset">charsets</a>
-and <a href="/unicode">common chars</a>.</p>
+say "<h1>\u$info->{title} scripts</h1>";
+say "<p>$_</p>" for $info->{intro} || ();
+say '<div class="section">';
 
-<div class="section">
-
-<:
 use Shiar_Sheet::FormatChar;
 my $glyphs = Shiar_Sheet::FormatChar->new;
 unless (exists $get{v}) {
@@ -37,27 +37,16 @@ unless (exists $get{v}) {
 
 my $scriptname = eval { Data('writing-script') }; # optional translations
 $_ = showlink($_, "/latin") for $scriptname->{latn} || ();
+$_ = showlink($_, "/writing/brahmi") for $scriptname->{brah} || ();
 
-for (
-       [phnx => 'Phoenician'],
-       [brah => 'Brahmi'],
-) {
-       my ($source, $title) = @$_;
-       my $info = eval { Data("writing-$source") } or do {
-               say "<h2>$title</h2>";
-               printf "<p>%s: <em>%s</em>.</p>\n", @{$@};
-               next;
-       };
-       my $rows = $info->{list} or next;
-       $glyphs->print($title => [map {
+say $glyphs->table([map {
                my $ref = $_;
                my $lead = s/^(-)// && $1;
                (map { ".>$lead$_" }
                        $scriptname->{$source.'_'.$_} || $scriptname->{$_} || $_
                ),
                @{ $info->{table}->{$ref} || [] }
-       } @{$rows}]);
-}
+} @{$rows}]);
 
 say "</div>\n";