X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/014511a96f19e407f789bd028937691275681902..HEAD:/sample.plp diff --git a/sample.plp b/sample.plp index 6de2b98..36ad2b4 100644 --- a/sample.plp +++ b/sample.plp @@ -1,28 +1,40 @@ <(common.inc.plp)><: -my $textinc = 'data/unicode-sampler/unicode.txt'; +my $textinc = 'sample.txt'; Html({ title => "unicode sampler", - version => '2.0', + version => '2.1', stylesheet => [qw'light dark mono red'], - data => $textinc, + data => [$textinc], + image => 'sample.png', }); open my $source, '<', $textinc - or die "Could not open text at $textinc: $!\n"; + or Abort("Could not open text at $textinc", 501, $!); local $/ = "\n\n"; my $top = readline $source; -my ($title, $hr, $intro) = split /\n(\H)$1+\n/, $top, 2; +my ($title, $hr, $intro) = split /\n(\pP)\1+\n/, $top, 2; say "

$title

"; +say <<"."; +

HTML display of plain text +intended for monospaced (terminal) output. +Compare an expected rendering of the overview. +

+. say '
';
 print $intro;
 
 while (my $p = readline $source) {
 	EscapeHTML($p);
-	$p =~ s{ \A (\N+:) \n\Z }{

$1

}x; + $p =~ s{ \A ((\pL+) \N*:) \n }{

$1

}x; + if ($2 eq 'Unicode') { + # table without proper direction control + $p =~ s/^(?= )/\x{202d}/gm; # ltr override every line + } + $p =~ s{(?<=^ )([\p{Latin} ]+:)}{$1}gm; print $p; }