1 04eab9af 2022-08-25 op package GotMArc;
7 04eab9af 2022-08-25 op our @ISA = qw(Exporter);
8 2064ca3f 2022-08-25 op our @EXPORT_OK = qw($logo san mid2path initpage endpage);
10 04eab9af 2022-08-25 op our $logo = <<'EOF';
11 04eab9af 2022-08-25 op <a href="https://gameoftrees.org" target="_blank">
12 04eab9af 2022-08-25 op <img srcset='/got-tiny.png, /got-tiny@2x.png 2x'
13 04eab9af 2022-08-25 op src='/got-tiny.png'
14 04eab9af 2022-08-25 op width='64' height='39'
15 04eab9af 2022-08-25 op alt='"GOT", but the "O" is a cute, smiling sun' /></a>
19 04eab9af 2022-08-25 op my $str = shift;
20 04eab9af 2022-08-25 op $str =~ s/&/\&/g;
21 04eab9af 2022-08-25 op $str =~ s/</\</g;
22 04eab9af 2022-08-25 op $str =~ s/>/\>/g;
26 2064ca3f 2022-08-25 op sub mid2path {
27 2064ca3f 2022-08-25 op my $mid = shift;
28 2064ca3f 2022-08-25 op $mid =~ s,_,__,g;
29 2064ca3f 2022-08-25 op $mid =~ s,/,_,g;
33 04eab9af 2022-08-25 op my $hdr = do {
34 04eab9af 2022-08-25 op local $/ = undef;
35 04eab9af 2022-08-25 op open my $fh, "<", "head.html"
36 04eab9af 2022-08-25 op or die "can't open head.html: $!";
40 04eab9af 2022-08-25 op sub initpage {
41 04eab9af 2022-08-25 op my ($fh, $title) = @_;
42 04eab9af 2022-08-25 op say $fh $hdr =~ s/TITLE/$title/r;
45 04eab9af 2022-08-25 op my $foot = do {
46 04eab9af 2022-08-25 op local $/ = undef;
47 04eab9af 2022-08-25 op open my $fh, "<", "foot.html"
48 04eab9af 2022-08-25 op or die "can't open foot.html: $!";
53 04eab9af 2022-08-25 op my $fh = shift;
54 04eab9af 2022-08-25 op say $fh $foot;