There's a lot of HTML documentation on my computer, but it's
wonderfully hard to find and use compared to man pages
because it's not indexed.

So I started building a Perl script to create a top-level
HTML index page automatically from the .html files it
finds lying around.  I started with just the contents of
/usr/share/doc.

Before I go too much farther, I thought I'd ask if anyone knows
of an existing product (that is surely more refined than
this little starter gizmo I've got so frar) that does the
same or similar thing?

If not, are there any other places where generally useful
HTML might be hiding?

++ kevin

PS: the script so far:


#!/usr/bin/perl -w

chdir "/usr/share/doc" or die "Cannot cd to /usr/share/doc: $!";

open FIND, "find . -name index.html |sort|" or die "Cannot fork: $!";
print "<head><title>Index of /usr/share/doc index files</title>\n";
print "<style type=\"text/css\">\n";
print "    li, p { margin-top: 0in; margin-bottom: 0in; }\n";
print "</style>\n";
print "</head>\n";
print "<body>\n";
print "<h1>Index of /usr/share/doc index files</h1>\n";
print "<ul>\n";

while (<FIND>) {
   chomp;
   s:^\./::;
   $path = $_;
   $path =~ s:/index.html$::;

   print "    <li><p><a href=\"$_\">$path</a></li>\n";

}
close FIND;
print "</ul>\n";
print "</body>\n";

--
Kevin O'Gorman, PhD
--
gentoo-user@gentoo.org mailing list

Reply via email to