Skip to content

Commit f589a70

Browse files
committed
autodoc: Allow specifying a section may be empty
There are lots of empty sections in perlintern, but until this commit it was assumed that all sections would have something in perlapi. This allows the user to specify that particular sections may not have perlapi entries.
1 parent 6186e7e commit f589a70

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

autodoc.pl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,10 +2297,14 @@ ($destpod)
22972297
for my $section_name (sort dictionary_order keys %valid_sections) {
22982298
my $section_info = $dochash->{$section_name};
22992299

2300-
# We allow empty sections in perlintern.
2301-
if (! $section_info && $podname eq $api) {
2302-
warn "Empty section '$section_name' for $podname; skipped";
2303-
next;
2300+
if (! $section_info) {
2301+
# We always allow empty sections in perlintern.
2302+
if ( $podname eq $api
2303+
&& ! $valid_sections{$section_name}{may_be_empty_in_perlapi})
2304+
{
2305+
warn "Empty section '$section_name' for $podname; skipped";
2306+
next;
2307+
}
23042308
}
23052309

23062310
print $fh "\n=head1 $section_name\n";

0 commit comments

Comments
 (0)