use Pod::Simple::Search;
@ISA = qw(Pod::Simple::HTML);
+# Add a link back to the index page to the top and bottom of each generated
+# page.
+#
+# The hideous approach we have to use is because, unless we create a
+# Pod::Simple::HTML object and then rebless it, the html_header_after_title
+# and html_footer subs are placed in the OpenAFS::HTML package. That means we
+# can't override them in a subclass and still call the SUPER version since
+# we'll be overwriting the SUPER version, and there aren't other good
+# opportunities to change the default values that I can see.
+sub new {
+ my $class = shift;
+ my $self = Pod::Simple::HTML->new (@_);
+ bless ($self, 'OpenAFS::HTML');
+ my $link = '<p class="indexlink"><a href="../index.html">'
+ . 'Back to Index</a></p>' . "\n";
+ my $after = $self->html_header_after_title;
+ $self->html_header_after_title ($after . $link);
+ my $end = $self->html_footer;
+ $self->html_footer ($link . $end);
+ return $self;
+}
+
sub do_man_link {
my ($self, $token) = @_;
my $page = $token->attr ('to');
$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;
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>
unless ($name) {
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 ]);