Gentoo Archives: gentoo-user

From: Kevin O'Gorman <kogorman@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Documentation Index
Date: Sun, 31 Dec 2006 00:12:21
Message-Id: 9acccfe50612301603k15644cu3b2a7777ad975b30@mail.gmail.com
1 There's a lot of HTML documentation on my computer, but it's
2 wonderfully hard to find and use compared to man pages
3 because it's not indexed.
4
5 So I started building a Perl script to create a top-level
6 HTML index page automatically from the .html files it
7 finds lying around. I started with just the contents of
8 /usr/share/doc.
9
10 Before I go too much farther, I thought I'd ask if anyone knows
11 of an existing product (that is surely more refined than
12 this little starter gizmo I've got so frar) that does the
13 same or similar thing?
14
15 If not, are there any other places where generally useful
16 HTML might be hiding?
17
18 ++ kevin
19
20 PS: the script so far:
21
22
23 #!/usr/bin/perl -w
24
25 chdir "/usr/share/doc" or die "Cannot cd to /usr/share/doc: $!";
26
27 open FIND, "find . -name index.html |sort|" or die "Cannot fork: $!";
28 print "<head><title>Index of /usr/share/doc index files</title>\n";
29 print "<style type=\"text/css\">\n";
30 print " li, p { margin-top: 0in; margin-bottom: 0in; }\n";
31 print "</style>\n";
32 print "</head>\n";
33 print "<body>\n";
34 print "<h1>Index of /usr/share/doc index files</h1>\n";
35 print "<ul>\n";
36
37 while (<FIND>) {
38 chomp;
39 s:^\./::;
40 $path = $_;
41 $path =~ s:/index.html$::;
42
43 print " <li><p><a href=\"$_\">$path</a></li>\n";
44
45 }
46 close FIND;
47 print "</ul>\n";
48 print "</body>\n";
49
50 --
51 Kevin O'Gorman, PhD
52 --
53 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Documentation Index Graham Murray <graham@×××××××××××.uk>
Re: [gentoo-user] Documentation Index Jerry McBride <mcbrides9@×××××××.net>