sample: format section titles as html headers
[sheet.git] / sample.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => "unicode sampler",
5         version => '2.0',
6         stylesheet => [qw'light dark mono red'],
7 });
8
9 open my $source, '<', 'data/unicode-sampler/unicode.txt'
10         or die "Could not open text: $!\n";
11 local $/ = "\n\n";
12
13 my $top = readline $source;
14 my ($title, $hr, $intro) = split /\n(\H)$1+\n/, $top, 2;
15 say "<h1>$title</h1>";
16
17 say '<pre>';
18 print $intro;
19
20 while (my $p = readline $source) {
21         EscapeHTML($p);
22         $p =~ s{ \A (\N+:) \n\Z }{<h2>$1</h2>}x;
23         print $p;
24 }
25
26 say "</pre>\n";