From: Mischa POSLAWSKY Date: Tue, 18 Apr 2017 22:23:21 +0000 (+0200) Subject: digits: group rows into table presets X-Git-Tag: v1.10~124 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/7c6662e77e3c64d1210daa5b444a340fc57b2884 digits: group rows into table presets --- diff --git a/digits.plp b/digits.plp index bc43593..6666b8f 100644 --- a/digits.plp +++ b/digits.plp @@ -13,6 +13,11 @@ Html({ )], stylesheet => [qw( light dark circus mono red )], data => [qw'writing-digits.inc.pl'], + raw => <<'EOT', + +EOT }); :> @@ -24,7 +29,6 @@ in various writing systems.

<: -use List::Util qw( pairs ); use Shiar_Sheet::FormatChar 1.08; my $glyphs = Shiar_Sheet::FormatChar->new; unless (exists $get{v}) { @@ -36,16 +40,20 @@ unless (exists $get{v}) { my $scriptname = do 'writing-script.inc.pl'; $_ = qq{$_} for $scriptname->{latn} || (); -my @table = do "writing-digits.inc.pl"; +my %table = do "writing-digits.inc.pl"; die "Table data not found: $_\n" for $@ || $! || (); -say $glyphs->tabletag; -for my $row (pairs @table) { - my ($id, $info) = @{$row}; - my $title = $info->{title} // $scriptname->{$id} || $id; - print $glyphs->row([ ".>$title", @{$info->{list}} ]); +sub printtable { + say '
', $glyphs->tabletag; + for my $id (@_) { + my $info = $table{$id}; + my $title = $info->{title} // $scriptname->{$id} || $id; + print $glyphs->row([ ".>$title", @{$info->{list}} ]); + } + say '
'; } -say ''; + +printtable(@{ $table{$_} }) for @{ $table{default} }; :>
diff --git a/writing-digits.inc.pl b/writing-digits.inc.pl index 63e2af5..5418be5 100644 --- a/writing-digits.inc.pl +++ b/writing-digits.inc.pl @@ -1,5 +1,14 @@ use utf8; ( +default => [qw( brahmi western sign eastern )], +eastern => [qw( hant hans suzhou rod )], +brahmi => [qw( + khmr java bali sund talu lana lanahora laoo mlym taml cham kali mymr cakm + thai knda telu tibt lepc beng olck saur orya guru gujr deva brahnumb brah +)], +western => [qw( arabindi arabpers ethi copt latn latnlat xsux maya teng tlh osma brai )], +sign => [qw( suttus suttbe suttnl )], + hant => {list => [qw{ >- 壹 貳 參 肆 伍 陸 柒 捌 玖 零 }]}, hans => {list => [qw{ 〇 一 二 三 四 五 六 七 八 九 十 }]}, suzhou => {list => [qw{ >- 〡 〢 〣 〤 〥 〦 〧 〨 〩 〸 }], title => 'Suzhou'},