X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FPod%2FText.pm;h=98dd434d6d415c9882cc6c313067ccc258866a90;hb=2504ae5250790bc6da9ecd41645e0005cd550a86;hp=d52bb538497ccd4c40e4f59c2ebfaa03d2fdb9e9;hpb=55595e835ecd270061d73c45c43db17eca4eee1f;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Pod/Text.pm b/lib/Pod/Text.pm index d52bb53..98dd434 100644 --- a/lib/Pod/Text.pm +++ b/lib/Pod/Text.pm @@ -1,7 +1,7 @@ # Pod::Text -- Convert POD data to formatted ASCII text. # -# Copyright 1999, 2000, 2001, 2002, 2004, 2006 -# by Russ Allbery +# Copyright 1999, 2000, 2001, 2002, 2004, 2006, 2008 +# Russ Allbery # # This program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. @@ -37,10 +37,7 @@ use Pod::Simple (); # We have to export pod2text for backward compatibility. @EXPORT = qw(pod2text); -# Don't use the CVS revision as the version, since this module is also in Perl -# core and too many things could munge CVS magic revision strings. This -# number should ideally be the same as the CVS revision in podlators, however. -$VERSION = 3.08; +$VERSION = 3.11; ############################################################################## # Initialization @@ -88,6 +85,13 @@ sub new { my @opts = map { ("opt_$_", $opts{$_}) } keys %opts; %$self = (%$self, @opts); + # Send errors to stderr if requested. + if ($$self{opt_stderr}) { + $self->no_errata_section (1); + $self->complain_stderr (1); + delete $$self{opt_stderr}; + } + # Initialize various things from our parameters. $$self{opt_alt} = 0 unless defined $$self{opt_alt}; $$self{opt_indent} = 4 unless defined $$self{opt_indent}; @@ -241,7 +245,8 @@ sub reformat { return $self->wrap ($_); } -# Output text to the output device. +# Output text to the output device. Replace non-breaking spaces with spaces +# and soft hyphens with nothing. sub output { my ($self, $text) = @_; $text =~ tr/\240\255/ /d; @@ -634,6 +639,9 @@ __END__ Pod::Text - Convert POD data to formatted ASCII text +=for stopwords +alt stderr Allbery Sean Burke's Christiansen + =head1 SYNOPSIS use Pod::Text; @@ -712,6 +720,11 @@ spaces, and will try to preserve that spacing. If set to false, all consecutive whitespace in non-verbatim paragraphs is compressed into a single space. Defaults to true. +=item stderr + +Send error messages about invalid POD to standard error instead of +appending a POD ERRORS section to the generated output. + =item width The column at which to wrap text on the right-hand side. Defaults to 76. @@ -777,7 +790,8 @@ how to use Pod::Simple. =head1 COPYRIGHT AND LICENSE -Copyright 1999, 2000, 2001, 2002, 2004, 2006 Russ Allbery . +Copyright 1999, 2000, 2001, 2002, 2004, 2006, 2008 Russ Allbery +. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.