2009-01-02 01:13:46 +00:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
#script to turn logbook.txt files into reasonable HTML files:
|
|
|
|
#logbook.html and trips
|
|
|
|
# very basic. Doesn't deal with trip IDs yet.
|
|
|
|
# Requires trip header format to be consistent:
|
|
|
|
#===YYYY-MM-DD | title | <people list>===
|
|
|
|
#and T/U: to always look like that and not also be mentioned in text
|
|
|
|
#edit year below manually. Used for 2006-2008
|
|
|
|
|
|
|
|
#triplist file doesn;t get a TU entry if none in logbook entry. Really out
|
|
|
|
# to be improved to normalise table
|
|
|
|
|
|
|
|
#print ("param1:$1");
|
|
|
|
|
|
|
|
#die;
|
|
|
|
my $year="2008";
|
|
|
|
|
|
|
|
my $infile=$year."logbook.txt";
|
|
|
|
my $outfile="logbook.html";
|
|
|
|
my $tripfile="trips.html";
|
|
|
|
|
|
|
|
open my $in, "<", $infile or die;
|
|
|
|
open my $out, ">", $outfile or die;
|
|
|
|
open my $triplist, ">", $tripfile or die;
|
|
|
|
|
2020-02-07 23:52:14 +00:00
|
|
|
print $out ("<!DOCTYPE html>
|
|
|
|
<html>
|
2009-01-02 01:13:46 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
|
2020-04-11 16:21:42 +01:00
|
|
|
<title>$year Expo Logbook</title>
|
|
|
|
<meta name="keywords" content="NOEDIT">
|
|
|
|
</head>
|
2024-12-16 22:14:46 +00:00
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/main2.css\" />
|
2009-01-02 01:13:46 +00:00
|
|
|
<style type=\"text/css\">
|
|
|
|
.tripdate { float: left;}
|
|
|
|
.trippeople { float: right;}
|
|
|
|
.triptitle { font-size: 120%; text-align: center; font-weight: bold; clear: both }
|
|
|
|
.timeug { text-align: right; font-weight: bold }
|
|
|
|
p { clear: both }
|
|
|
|
</style>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h1>Expo $year</h1>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
");
|
|
|
|
|
2020-02-07 23:52:14 +00:00
|
|
|
print $triplist ("<!DOCTYPE html>
|
|
|
|
<html>
|
2009-01-02 01:13:46 +00:00
|
|
|
<head>
|
|
|
|
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
|
|
|
|
<title>Expo $year: trips index</title>
|
2024-12-16 22:14:46 +00:00
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/main2.css\">
|
2009-01-02 01:13:46 +00:00
|
|
|
<style type=\"text/css\">
|
|
|
|
tr.nc { font-style: italic }
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>Expo $year: trips index</h1>
|
|
|
|
<p>This is an index to all caving trips that took place on Expo $year,
|
|
|
|
plus anything else that people saw fit to record in the logbook. The
|
|
|
|
list of trips here includes everything mentioned in the logbook, any of
|
|
|
|
the callout books or the Time Underground page in the bier book.
|
|
|
|
</p>
|
|
|
|
<table class=\"trad\">
|
|
|
|
<thead> <tr>
|
|
|
|
<th>Date</th>
|
|
|
|
<th>Person</th>
|
|
|
|
<th>Dest'n</th>
|
|
|
|
<th>T/U</th>
|
|
|
|
<th>Logbook writeup</th>
|
|
|
|
<th>Survey notes</th>
|
|
|
|
</tr>
|
|
|
|
");
|
|
|
|
while(<$in>){
|
|
|
|
if (/^===.*(2008-\d\d-\d\d) \|(.*)\|(.*)===$/) {
|
|
|
|
print $out ("<hr />\n\n<div class=\"tripdate\" id=\"t$1\">$1</div>\n");
|
|
|
|
print $out ("<div class=\"trippeople\">$3</div>\n");
|
|
|
|
print $out ("<div class=\"triptitle\">$2</div>\n");
|
|
|
|
print $triplist (" <tr>\n <td>$1</td>\n <td>$3</td>\n <td>$2</td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n");
|
|
|
|
} elsif (m!T/U!i) {
|
|
|
|
chomp;
|
|
|
|
print $out ("<div class=\"timeug\">$_</div>\n");
|
|
|
|
} else {
|
|
|
|
print $out $_
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
print $out ("<ul>
|
|
|
|
<li><a href=\"index.html\">Back to $year Index</a></li>
|
|
|
|
<li><a href=\"../../pubs.htm\">Index</a> to all publications</li>
|
|
|
|
<li><a href=\"../../index.htm\">Back to Expeditions intro page</a></li>
|
|
|
|
<li><a href=\"../../../index.htm\">CUCC Home Page</a></li>
|
|
|
|
</ul>
|
|
|
|
</body>
|
|
|
|
</html>");
|
|
|
|
|
|
|
|
print $triplist (" </tbody>
|
|
|
|
</table>
|
2020-03-05 23:23:41 +00:00
|
|
|
<hr />
|
2009-01-02 01:13:46 +00:00
|
|
|
<!-- LINKS -->
|
|
|
|
<ul>
|
|
|
|
<li><a href=\"../../infodx.htm\">Main index of the expedition site</a></li>
|
|
|
|
<li><a href=\"../../index.htm\">CUCC in Austria introduction page</a></li>
|
|
|
|
<li><a href=\"../../../index.htm\">CUCC Home Page</a></li>
|
|
|
|
</ul>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
");
|
|
|
|
|
|
|
|
close $in;
|
|
|
|
close $out;
|
|
|
|
close $triplist;
|