#!/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 | === #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; print $out (" $year Expo Logbook

Expo $year


"); print $triplist (" Expo $year: trips index

Expo $year: trips index

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.

"); while(<$in>){ if (/^===.*(2008-\d\d-\d\d) \|(.*)\|(.*)===$/) { print $out ("
\n\n
$1
\n"); print $out ("
$3
\n"); print $out ("
$2
\n"); print $triplist (" \n \n \n \n \n \n \n \n"); } elsif (m!T/U!i) { chomp; print $out ("
$_
\n"); } else { print $out $_ } } print $out (""); print $triplist ("
Date Person Dest'n T/U Logbook writeup Survey notes
$1$3$2

"); close $in; close $out; close $triplist;