#! /opt/bin/perl # ________________________________________________________________ # /\ /\ CyberWeb SoftWare: Internet Information Systems # -{-<*>-}- World-Wide Web # __\/_\/_________________________________________________________ # Author : Alan Richmond # File : index.pl # Purpose : Process Index into encyclopedia. # ________________________________________________________________ require "/www2/wdvl/wdvl/Software/Perl/ht_subs.pl"; open (In,") { if (/^[A-Z]/) { # Letter chop ; if ($count > 1) { print OUT "\n"; $x = $_; &Foot ; undef %v; $_ = $x; close (OUT); $v{'Prev'} = $L; $ix .= "\n"; } $L = $_; $v{'file'} = $L; $v{'url'} = "/WebRef/Index/$L.html"; $v{'Next'} = pack ("c", $count++ + 65); $v{'Next'} = "A" if $count == 26; $ix .= "$L\n"; open (OUT,">$L.html")||die$!; $v{'Title'} = "The Webmaster's Illustrated Encyclopedia: $L"; select OUT ; $v{'Class'} = "Plain"; &Head (1); print OUT "\n"; next ; } elsif (/^ (.*)/) { # Term chop ; $terms++; ($term, $url) = split(/\t+/, $1) ; $term =~ s/ /_/g; print OUT <
$term EOT $ix .="$term  \n"; $_ = ; if (/^# (\S+) (\d+),(\d+)/) { print OUT "

\"\n"; print OUT "

\n"; next ; } print OUT "\n"; } &Defn ; } &Foot ; undef %v; # print " $terms terms.\n"; $v{'url'} = '/WebRef/Index/'; $v{'file'} = "index"; $v{'Class'} = "Plain"; $v{'Next'} = "A"; $v{'Prev'} = "Z"; $v{'Title'} = "The Webmaster's Encyclopedia"; open (OUT,">index.html")||die; select OUT ; &Head (1); print OUT "$ix
"; &Foot ; undef %v; sub Defn { s/^$/
/; s/\{//g; s/\}/<\/i>/g; while (/\[(\w)([^\]]*)\]/) { $_ = $`; $l = $u = $1; $m = $v = $2; $x = $'; $u =~ tr/a-z/A-Z/; $v =~ s/ /_/g; $_ .= "$l$m"; $_ .= $x; } print OUT ; }