6 open my $footerfile, "<", shift @ARGV or die "footer: open: $!\n";
8 $footer .= $_ while <$footerfile>;
12 $arg =~ /(.*\/)?([^\/]+)\.html$/ or die;
14 open my $gamefile, "<", $arg or die "$arg: open: $!\n";
16 my $docname = $filename;
17 chomp(my $puzzlename = <$gamefile>);
18 while ($puzzlename =~ s/^([^:=]+)(=([^:]+))?://) {
19 if ($1 eq "unfinished") {
21 } elsif ($1 eq "docname") {
24 die "$arg: unknown keyword '$1'\n";
27 my $instructions = "";
28 $instructions .= $_ while <$gamefile>;
31 open my $outpage, ">", "${filename}.html";
33 my $unfinishedtitlefragment = $unfinished ? "an unfinished puzzle " : "";
34 my $unfinishedheading = $unfinished ? "<h2 align=center>an unfinished puzzle</h2>\n" : "";
38 $unfinishedpara = <<EOF;
40 You have found your way to a page containing an <em>unfinished</em>
41 puzzle in my collection, not linked from the <a href="../">main
42 puzzles page</a>. Don't be surprised if things are hard to understand
43 or don't work as you expect.
47 <a href="../">Back to main puzzles page</a> (which does not link to this)
53 <a href="../doc/${docname}.html#${docname}">Full instructions</a>
55 <a href="../">Back to main puzzles page</a>
62 <title>${puzzlename}, ${unfinishedtitlefragment}from Simon Tatham's Portable Puzzle Collection</title>
63 <link rel="stylesheet" type="text/css" href="../../sitestyle.css" name="Simon Tatham's Home Page Style">
64 <script type="text/javascript" src="resize-puzzle-applet.js"></script>
66 <body onLoad="initResizablePuzzleApplet();">
67 <h1 align=center>${puzzlename}</h1>
69 <h2 align=center>from Simon Tatham's Portable Puzzle Collection</h2>
74 <table cellpadding="0">
77 <applet id="applet" archive="${filename}.jar" code="PuzzleApplet"
78 width="700" height="500">
82 <div id="eresize" style="width:5px;height:500px;cursor:e-resize;"></div>
86 <div id="sresize" style="width:700px;height:5px;cursor:s-resize;"></div>
89 <div id="seresize" style="width:5px;height:5px;cursor:se-resize;"></div>