Update Required MIBs, GLOBALS and TABLE ENTRIES sections to

include links in cross-references to other SNMP::Info pages.
This commit is contained in:
Bill Fenner
2006-11-17 00:59:33 +00:00
parent 948921930b
commit 87063bc4d3
27 changed files with 227 additions and 192 deletions

35
t/docmunge Executable file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/perl -i.bak
#
# [Re-]write POD to create cross-links between Required MIBs, GLOBALS
# and TABLE ENTRIES sections.
# This is a horrible jumble of heuristics, but works with
# all of the existing files. It has only one false positive: HP.pm's
# mention of an SNMP::Info version number.
#
$section = undef;
$waiting = 0;
while (<>) {
if (eof) {
$section = undef;
$waiting = 0;
}
if (/^=head(\d)/) {
$sl = $1;
if ($sl <= $level) {
$section = undef;
}
if (/(TABLE ENTRIES|GLOBALS|Required MIBs)/) {
$section = $1;
$level = $sl;
if ($section eq 'TABLE ENTRIES' || $section eq 'GLOBALS') {
$waiting = 1;
}
}
if ($waiting && /imported/i) {
$waiting = 0;
}
} elsif (defined($section) && !$waiting && /^[^=]/ && /SNMP::Info/) {
s,(?:L<)?(SNMP::Info[a-zA-Z0-9:]*)(?:/[^>]+)?(?:>)?,L<$1/"$section">,g;
}
print;
}