index: release v1.18 with only altgr index linked
[sheet.git] / writing.plp
1 <(common.inc.plp)><:
2
3 my $source = lc $Request || 'phnx';
4 $source =~ s/^brah\Kmi$//;
5 my $include = "writing-$source";
6
7 my $info = eval { Data($include) } || {};
8
9 Html({
10         title => $info->{pagetitle} || "$info->{title} scripts comparison sheet",
11         version => $info->{version} || '0.1',
12         description => $info->{description},
13         keywords => [@{ $info->{keywords} // []}, qw(
14                 writing script glyph unicode character letter comparison history
15                 alphabet sample test language multilingual
16         )],
17         stylesheet => [qw'light circus dark red mono'],
18         data => ["$include.inc.pl"],
19 });
20
21 my $rows = $info->{list} or Abort(
22         "Requested script parent <q>$source</q> not available",
23         '404 request not found',
24 );
25
26 say "<h1>\u$info->{title} scripts</h1>";
27 say "<p>$_</p>" for $info->{intro} || ();
28 say '<div class="section">';
29
30 use Shiar_Sheet::FormatChar;
31 my $glyphs = Shiar_Sheet::FormatChar->new;
32 unless (exists $get{v}) {
33         $glyphs->{unicode}--;
34         $glyphs->{anno}  = [];
35         $glyphs->{style} = 'univer';
36 }
37
38 my $scriptname = eval { Data('writing-script') }; # optional translations
39 $_ = showlink($_, "/latin") for $scriptname->{latn} || ();
40 $_ = showlink($_, "/writing/brahmi") for $scriptname->{brah} || ();
41
42 say $glyphs->table([map {
43         my $lead = s/^(-)// && $1;
44         (map { ".>$lead$_" }
45                 $scriptname->{$source.'_'.$_} || $scriptname->{$_} || $_
46         ),
47         @{ $info->{table}->{$_} || [] }
48 } @{$rows}]);
49
50 say "</div>\n";
51
52 say for '<hr/>', $glyphs->legend;
53