scout: Tidy header includes
[openafs.git] / doc / man-pages / generate-html
index 9bde41b..13fdff5 100755 (executable)
@@ -59,6 +59,24 @@ $Pod::Simple::HTML::Tagmap{'/item-bullet'} = '</p></li>';
 $Pod::Simple::HTML::Tagmap{'item-number'} = '<li><p>';
 $Pod::Simple::HTML::Tagmap{'/item-number'} = '</p></li>';
 
+# This horrific hack is required because Pod::Simple::HTMLBatch has no way
+# of setting search options and we have to set laborious to true in order
+# to pick up man pages like krb.conf(5).
+package OpenAFS::Search;
+
+use strict;
+use vars qw(@ISA);
+
+use Pod::Simple::Search;
+@ISA = qw(Pod::Simple::HTML);
+
+sub new {
+    my $class = shift;
+    my $object = Pod::Simple::Search->new;
+    $object->laborious (1);
+    return $object;
+}
+
 package main;
 
 use strict;
@@ -66,6 +84,9 @@ use strict;
 use File::Copy;
 use Pod::Simple::HTMLBatch;
 
+# Override the search class to set laborious.
+$Pod::Simple::HTMLBatch::SEARCH_CLASS = 'OpenAFS::Search';
+
 our $HEADER = <<'EOH';
 <html>
 <head>
@@ -88,7 +109,7 @@ sub scan_names {
         my $section = $dir;
         $section =~ s/^pod//;
         opendir (D, $dir) or die "Cannot open $dir: $!\n";
-        for my $file (sort grep { !/^\./ && !/CVS/ } readdir D) {
+        for my $file (sort grep { !/^\./ && /\.pod$/ } readdir D) {
             open (F, "$dir/$file") or die "Cannot open $dir/$file: $!\n";
             my ($name, $desc);
             local $_;
@@ -101,6 +122,9 @@ sub scan_names {
                 warn "$dir/$file: cannot find NAME section, skipping\n";
             }
             $name =~ s/^(backup|bos|fs|fstrace|kas|pts|symlink|uss|vos)_/$1 /;
+            if ($section eq '5') {
+                $name =~ s/_/ /g;
+            }
             my $page = $file;
             $page =~ s/\.pod$//;
             push (@index, [ $section, $name, $page, $desc ]);