X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/87cefe5b2565b86fdfb3404b4ed9c180282f0272..HEAD:/sample.plp diff --git a/sample.plp b/sample.plp index 7f8b636..36ad2b4 100644 --- a/sample.plp +++ b/sample.plp @@ -1,20 +1,41 @@ <(common.inc.plp)><: +my $textinc = 'sample.txt'; + Html({ title => "unicode sampler", - version => '2.0', + version => '2.1', stylesheet => [qw'light dark mono red'], + data => [$textinc], + image => 'sample.png', }); -open my $source, '<', 'data/unicode-sampler/unicode.txt' - or die "Could not open text: $!\n"; +open my $source, '<', $textinc + or Abort("Could not open text at $textinc", 501, $!); +local $/ = "\n\n"; -my $title = readline $source; -my $hr = readline $source; +my $top = readline $source; +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) {
-	print EscapeHTML($p);
+	EscapeHTML($p);
+	$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; } + say "
\n";