podwrapper: Remove =encoding from input files and add it back in podwrapper.

This changes podwrapper so that the input (POD) files should not
contain an =encoding directive.  However they must be UTF-8.
Podwrapper then adds the '=encoding utf8' directive back during final
generation.

This in particular avoids problems with nested =encoding directives in
fragments.  These break POD, and are undesirable anyway.
This commit is contained in:
Richard W.M. Jones
2014-03-18 15:30:03 +00:00
parent ad33a5434c
commit c4dc70f8c4
47 changed files with 6 additions and 94 deletions

View File

@@ -31,8 +31,6 @@ use File::Basename;
# https://www.redhat.com/archives/libguestfs/2013-May/thread.html#00088
eval { $Text::Wrap::huge = "overflow" };
=encoding utf8
=head1 NAME
podwrapper.pl - Generate libguestfs documentation from POD input files
@@ -291,6 +289,12 @@ foreach (@verbatims) {
if $content eq $oldcontent;
}
# There should be no =encoding line present in the content (we will add one).
die "$progname: $input: =encoding must not be present in input\n"
if $content =~ /^=encoding/m;
$content = "=encoding utf8\n\n$content";
if ($strict_checks) {
# Verify sections present / not present.
die "$progname: $input: missing AUTHOR or AUTHORS section\n"