3 my $textinc = 'data/unicode-sampler/unicode.txt';
4 my $proto = sprintf('http%s://', !!$ENV{HTTPS} && 's');
5 my $preview = "$proto$ENV{HTTP_HOST}/sample.png";
8 title => "unicode sampler",
10 stylesheet => [qw'light dark mono red'],
12 raw => qq(<meta property="og:image" content="$preview" />),
15 open my $source, '<', $textinc
16 or Abort("Could not open text at $textinc", 501, $!);
19 my $top = readline $source;
20 my ($title, $hr, $intro) = split /\n(\pP)\1+\n/, $top, 2;
21 say "<h1>$title</h1>";
22 printf '<p>HTML display of <a href="%s">plain text</a>', $textinc;
23 say ' intended for monospaced (terminal) output.</p>';
28 while (my $p = readline $source) {
30 $p =~ s{ \A ((\pL+) \N*:) \n }{<h2 id="\L$2\E">$1</h2>}x;
31 $p =~ s{(?<=^ )([\p{Latin} ]+:)}{<em>$1</em>}gm;