#!/usr/bin/perl # Construct the two pieces of my main puzzle collection web page that # need to vary with the set of puzzles: the big list of s with # puzzle pictures and links etc, and the list of Windows executable # files down in the downloads section. use strict; use warnings; use HTML::Entities; my $gamedesc = shift @ARGV; open my $desc, "<", $gamedesc or die "$gamedesc: open: $!\n"; open my $spans, ">", "wwwspans.html" or die "wwwspans.html: open: $!\n"; open my $links, ">", "wwwlinks.html" or die "wwwspans.html: open: $!\n"; my $n = 0; while (<$desc>) { chomp; my ($id, $win, $displayname, $description, $summary) = split /:/, $_; printf $spans ''. ''. ''. ''. '
%s
'. ''. '
['. ' java '. '|'. ' js '. '|'. ' manual '. ']
['. ' %s '. ']
%s
'. "\n", encode_entities($displayname), encode_entities($id), encode_entities($description), encode_entities($id), encode_entities($id), encode_entities($id), encode_entities($id), encode_entities($id), encode_entities($win), encode_entities($win), encode_entities($summary); if ($n > 0) { if ($n % 5 == 0) { print $links "
"; } else { print $links " | "; } } printf $links '%s', encode_entities($win), encode_entities($win); $n++; } close $desc; close $spans; close $links;