#!/usr/bin/env perl # $NetBSD: mkact.pl,v 1.5 2007/01/24 04:21:28 rillig Exp $ # # # # Reads index.act-template, and inserts and entries of the form # @@@ENTRY: whatever # comments are possible # html files containing tags are expected as $entry-img.html # html files containing descriptions are expected as $entry-txt.html $pic_left=0; $debug=0; sub printfile { local($file)=@_; if ( ! -f $file && -f "../../../gallery/in-Action/$file" ) { $file = "../../../gallery/in-Action/$file"; } open(F, "cat $file|") or die "Cannot open $file for reading: $!\n"; while() { s/\n"; } if (/\@\@\@ENTRY: (\S*)\s+(\S*)/) { $entry=$1; $type=$2; print "\n\n"; print "\"\n"; print "$type\n"; print "\"\n"; print "\n"; print "$entry:
\n" if $debug; print ("\n"); if ($pic_left) { print ""; print ""; $pic_left=0; } else { print ""; print ""; $pic_left=1; } print ("
"; printfile "$entry-img.html"; print ""; printfile "$entry-txt.html"; print ""; printfile "$entry-txt.html"; print ""; printfile "$entry-img.html"; print "
\n\n" . "\n" ); print "\"\n"; print ("\n\n"); print "\n"; print "\"\n"; print "\"\n"; print "\"\n"; print "\"\n"; print "\"\n\n"; } else { print "$_"; } }