DEVEL15-man-page-html-generation-hack-20080713
authorRuss Allbery <rra@stanford.edu>
Mon, 14 Jul 2008 02:54:18 +0000 (02:54 +0000)
committerRuss Allbery <rra@stanford.edu>
Mon, 14 Jul 2008 02:54:18 +0000 (02:54 +0000)
LICENSE BSD

Pod::Simple::Search ignores every POD file that doesn't "look right," which
means it skips files containing a period (like krb.conf.pod) unless you set
a search option.  Pod::Simple::HTMLBatch has no way to set search options.

Apply a truly horrible hack to get around this.

(cherry picked from commit 2a92f43987cd08dc0134b775e0d118894d22d3e5)

doc/man-pages/generate-html

index 11d47c6..83570b1 100755 (executable)
@@ -37,6 +37,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;
@@ -44,6 +62,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>