2 # Copyright (C) all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
5 use Fcntl qw(SEEK_SET);
6 my $have_search = eval { require PublicInbox::Search; 1 };
7 my $addr = 'meta@public-inbox.org';
9 open my $fh, '+<', $pod or die "open($pod): $!";
10 my $s = do { local $/; <$fh> } // die "read $!";
12 $s =~ s!^=head1 COPYRIGHT\n.+?^=head1([^\n]+)\n!=head1 COPYRIGHT
14 Copyright all contributors L<mailto:$addr>
16 License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
21 $s =~ s!^=head1 CONTACT\n.+?^=head1([^\n]+)\n!=head1 CONTACT
23 Feedback welcome via plain-text mail to L<mailto:$addr>
25 The mail archives are hosted at L<https://public-inbox.org/meta/> and
26 L<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>
30 $have_search and $s =~ s!^=for\scomment\n
31 ^AUTO-GENERATED-SEARCH-TERMS-BEGIN\n
34 ^AUTO-GENERATED-SEARCH-TERMS-END\n
41 seek($fh, 0, SEEK_SET) or die "seek: $!";
42 truncate($fh, 0) or die "truncate: $!";
43 print $fh $s or die "print: $!";
44 close $fh or die "close: $!";
49 my $help = eval('\@PublicInbox::Search::HELP');
53 for ($i = 0; $i < @$help; $i += 2) {
54 my $pfx = $help->[$i];
56 $pad = $n if $n > $pad;
58 $s .= $help->[$i + 1];
62 my $padding = ' ' x ($pad + 4);
63 $s =~ s/^/$padding/gms;
64 $s =~ s/^$padding(\S+)\0/" $1".(' ' x ($pad - length($1)))/egms;
67 substr($s, 0, 0, "=for comment\nAUTO-GENERATED-SEARCH-TERMS-BEGIN\n\n");
68 $s .= "\n=for comment\nAUTO-GENERATED-SEARCH-TERMS-END\n";