3 # Copyright © 2000,2001 by VA Linux Systems, Inc.
5 # Generate index files for HTML man pages.
7 # Author: David Dawes <dawes@xfree86.org>
11 # Best viewed with tabs set to 4
15 print STDERR "Usage: mkhtmlindex.pl htmlmandir\n";
22 print STDERR "$dir is not a directory\n";
26 @vollist = ("1", "2", "3", "4", "5", "6", "7", "8", "9", "o", "l", "n", "p");
28 $indexprefix = "manindex";
30 foreach $vol (@vollist) {
32 $indexname="$dir/$indexprefix$vol.html";
34 # print "Processing volume $vol\n";
36 open(mindex, ">$indexname") || die "Can't create $indexname";
37 opendir(dir, "$dir") || die "Can't open $dir";
40 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
43 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
44 <TITLE>X.Org Manual pages: Section $vol</TITLE>
46 <BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">
48 <H1>X.Org Manual pages: Section $vol</H1>
53 foreach $file (sort readdir dir) {
54 if ($file =~ "\.$vol\.html") {
55 open(file, "<$dir/$file") || die "Can't open $dir/$file";
60 while (<file> && ! /<\/[hH]2>$/) {
69 $heading = "$heading" . "$_";
74 ($name, $descr) = split(/-/, $heading, 2);
75 $file =~ /(.*)\.$vol\.html/;
77 $descr =~ s/<[pP]>//g;
79 "<LI><A href=\"$file\">$fname</A> - $descr</LI>";
98 # print "Removing empty $indexname\n";