Skip to content

Commit e45cc9e

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 fbabdb5 commit e45cc9e

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
@@ -2310,10 +2310,14 @@ ($destpod)
23102310
for my $section_name (sort dictionary_order keys %valid_sections) {
23112311
my $section_info = $dochash->{$section_name};
23122312

2313-
# We allow empty sections in perlintern.
2314-
if (! $section_info && $podname eq $api) {
2315-
warn "Empty section '$section_name' for $podname; skipped";
2316-
next;
2313+
if (! $section_info) {
2314+
# We always allow empty sections in perlintern.
2315+
if ( $podname eq $api
2316+
&& ! $valid_sections{$section_name}{may_be_empty_in_perlapi})
2317+
{
2318+
warn "Empty section '$section_name' for $podname; skipped";
2319+
next;
2320+
}
23172321
}
23182322

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

0 commit comments

Comments
 (0)