#!/usr/bin/perl use Text::Tabs; $tabstop = 4; $target = shift @ARGV; open ( FILE, "<$target"); chomp ( @code = ); close FILE; foreach $line (@code) { $line =~ s/\/>/; $line = expand ($line); } unshift @code, "
    "; unshift @code, ""; while (@ARGV) { # add links to page # use filename description $linkname = shift; $linkdescrip = shift; $link_html = qq\ $linkdescrip
    \; print "Link = $link_html \n"; unshift @code, $link_html; } unshift @code,""; unshift @code," $target "; unshift @code, ""; push @code, "
"; push @code, "<" . "/code>"; # split to fool PM formatting! push @code, ""; push @code, ""; open (FILE,">".$target.".html"); $body = 0; foreach $line (@code) { if ( ( $line =~ m/^#.*/) || ( $line =~ m/^\/\*/ ) || ( $line =~ m/^[a-zA-Z0-9_]/) ) { $body = 1; } if ($line =~ m/^\<\/ol\>/) { $body = 0; } if ($body) { print FILE "
  • ".$line."\n"; } else { print FILE $line."\n"; } } close FILE;