X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/5ee97692d42eea5defce6d1ea12dc84e9578f608..bc90ff6381dc84bc5a16f2f337abad58f74bb116:/sample.plp diff --git a/sample.plp b/sample.plp index 15323a3..adae7bd 100644 --- a/sample.plp +++ b/sample.plp @@ -1,25 +1,34 @@ <(common.inc.plp)><: +my $textinc = 'data/unicode-sampler/unicode.txt'; +my $proto = sprintf('http%s://', !!$ENV{HTTPS} && 's'); +my $preview = "$proto$ENV{HTTP_HOST}/sample.png"; + Html({ title => "unicode sampler", version => '2.0', stylesheet => [qw'light dark mono red'], + data => [$textinc], + raw => qq(), }); -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 $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

"; +printf '

HTML display of plain text', $textinc; +say ' intended for monospaced (terminal) output.

'; 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; + $p =~ s{(?<=^ )([\p{Latin} ]+:)}{$1}gm; print $p; }