<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#-*- perl -*-
#
# Translate KEYWORDS.db to HTML
#

sub searchKey
{
    my $key=$_[0];
    my $retval = "&lt;a href=\"";
    $retval .= "javascript:searchInIndex('$key', false, true, false);";
    $retval .= "\"&gt;$key&lt;/a&gt;";
    return($retval);
}

@key = ();
while(&lt;&gt;){
    s/#.*//;
    chop;
    push(@key, $_) if $_;
}

@key = sort(@key);

$depth=0;
print("&lt;dl&gt;\n");
for($k=0;$k&lt;=$#key; $k++){

    ($keywords, $desc) = split(':', $key[$k]);
    @keywords = split('\|', $keywords);

    if($#keywords==0){
	for($n=0; $n&lt;$depth-$#keywords; $n++){
	    print "&lt;/ul&gt;";
	}
	print "&lt;/dd&gt;&lt;p&gt;\n" if($depth);
	print "&lt;dt&gt; $desc&lt;/dt&gt;\n&lt;dd&gt;\n";
    }
    else{
	for($n=0; $n&lt;$#keywords ; $n++){
	    print " ";
	}
	if($#keywords &gt; $depth){
	    print "&lt;ul&gt;&lt;li&gt;";
	    print searchKey($keywords[$#keywords]);
	    print ": $desc&lt;/li&gt;\n";
	}
	elsif($#keywords &lt; $depth){
	    for($n=0; $n&lt;$depth-$#keywords; $n++){
		print "&lt;/ul&gt;";
	    }
	    print "\n";
	    print "&lt;li&gt;", searchKey($keywords[$#keywords]);
	    print ": $desc&lt;/li&gt;\n";
	}
	else{
	    print "&lt;li&gt;", searchKey($keywords[$#keywords]);
	    print ": $desc&lt;/li&gt;\n";
	}
    }
    $depth=$#keywords;
}	
for($n=0; $n&lt;$depth; $n++){
    print "&lt;/ul&gt;";
}
print "&lt;/dd&gt;&lt;/dl&gt;\n";
	
</pre></body></html>