#!/usr/local/bin/perl -p
use
lib
qw (
lib ../lib );
BEGIN {
open
(IN,
"header.html"
) or
die
"can't read header.html"
;
s/\
$CIPP
:\:VERSION/
$CIPP::VERSION
/,
s/\
$DATE
/
scalar
(
localtime
(
time
))/e,
print
while
<IN>;
close
IN;
}
$in_body
= 1
if
/<body>/i;
$_
=
''
if
not
$in_body
;
s/^<P>$//
if
$dd
;
$dd
= /<DD>$/;
s/^<HR>$//;
s/<DT>/<P><DT>/g;
s/(<H1><A NAME="(COMM|NAME))/<!--NewPage-->\n$1/;
s!(<H1><A NAME="COMMAND.*?>(.*)</A></H1>)!$1<HR>!;
$in_index
= 1
if
/-- INDEX BEGIN/;
$in_index
= 0
if
/-- INDEX END/;
if
(
$in_index
) {
$command_chapters
= 1
if
/HREF=".COMMAND/;
$ul
= 1
if
/<UL>/;
$ul
= 0
if
m!</UL>!;
$_
=
''
if
$command_chapters
and
$ul
and /<LI>/;
$_
=
''
if
$command_chapters
and /<.?UL>/;
}
s!<H2>(.*?)</H2>!<BIG><B>$1</B></BIG>!g;
++
$pre
if
m!<pre>!i;
--
$pre
if
m!</pre>!i;
if
( not
$pre
) {
s!
&
;lt;!
<
;!g;
s!
&
;gt;!
>
;!g;
s!([\$\@\%]\w*)!<code>$1</code>!g;
s!(([A-Z_]+)\s*=\s*``([^
']*?)'
')!<code>$2=
"$3"
</code>!g;
}