#
# convert.pl
#
# run with the current directory as the one containing the .hhc files
#
# 2002/01/13 Ben Hekster
#
sub convert {
while (<>) {
if (/<\/?UL/i) {
if (/<\/UL/i) {
print "\n";
}
else {
print "
\n";
}
}
if (/<\/?OBJECT/i) {
if (/<\/OBJECT/i) {
if ($object eq "text/site properties") {
$title = 1;
}
elsif ($object eq "text/sitemap") {
if ($title) {
$title = 0;
print <
$name
$name
EOF
}
print "- $name\n";
}
$object = null;
}
else {
/type=\"([^"]*)\"/;
$object = $1;
}
}
if (/
EOF
}
$base = "./";
opendir(DIR, $base);
while ($_ = readdir(DIR)) {
if (/(.*)\.hhc/) {
open(STDOUT, ">$1.html");
open(STDIN, "<$1.hhc");
&convert;
}
}
closedir(DIR);