#!/usr/bin/perl -W use strict; -d "html" and system("rm -rf html"); mkdir "html", 0777 or die $!; mkdir "html/Search", 0777 or die $!; my %pages = (); pod2html('Xapian.pm', 'html/Search/Xapian.html'); mkdir "html/Search/Xapian", 0777 or die $!; for my $f () { my $o = $f; $o =~ s/\.pm$/.html/; pod2html($f, "html/Search/$o"); } for (sort keys %pages) { my $v = $pages{$_}; if ($v eq 'Y') { print "$_ has a POD but is never linked to\n"; } elsif ($v =~ /^N=/) { print "$_ has no POD but is linked to\n"; } elsif ($v eq 'N') { # print "$_ has no POD (but no links)\n"; } } sub pod2html { my ($in, $out) = @_; my $tmp = 'pod2html.tmp'; my $root = $out; $root =~ s![^/]+!..!g; $root =~ s!\.\./!!; $root =~ s!\.\./!!; my $is_pod; open POD, $in or die $!; while () { if (/^=/) { $is_pod = 1; last; } } close POD; my $class = $in; $class =~ s!\.pm$!!; $class =~ s!/!::!g; $class = "Search::$class"; open HTML, ">$out" or die $!; if (!$is_pod) { $pages{$class} = 'N' . ($pages{$class} || ''); print HTML < $class

No Perl-specific documentation currently exists for class $class - please refer to the C++ API documentation for now. EOT } else { $pages{$class} = 'Y' . ($pages{$class} || ''); system('pod2html', '--htmlroot', $root, '--infile', $in, '--outfile', $tmp) == 0 or die $!; if ($?) { die $?; } open TMP, $tmp or die $!; while () { s!>the (.*?) manpage$1