diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2013-01-04 14:33:58 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2013-01-04 14:33:58 +0000 |
commit | 537bc13a66609cf3ecd8c17c041c2c619b619197 (patch) | |
tree | 5211fac74714ada511cb68f62788e4abcb29c163 /cpan/podlators/scripts | |
parent | d2898d73a1ac5ef072641f07c70d9334e368d58a (diff) | |
download | perl-537bc13a66609cf3ecd8c17c041c2c619b619197.tar.gz |
Update podlators to CPAN version 2.5.0
[DELTA]
2013-01-02 Russ Allbery <rra@stanford.edu>
* VERSION: podlators 2.5.0 released.
* lib/Pod/Man.pm (guesswork): Extend a small-caps section through
the punctuation that commonly appears in license disclaimers so
that small caps isn't turned on and off at the boundaries of every
word, producing unreadable *roff.
* t/man.t: Test the updated small-caps behavior.
* lib/Pod/Man.pm (new): Support a new errors option with values
die, stderr, pod, and none. Convert the stderr option to the
errors option with value stderr. (#39007)
(end_document): Die if errors was set to die and there were POD
syntax errors.
* lib/Pod/Text.pm (new): Likewise.
(end_document): Likewise.
* scripts/pod2man: Support a new --errors option that sets the
underlying errors formatter option and default to dying on POD
syntax errors.
* scripts/pod2text: Likewise.
* t/man-options.t: Add support for catching exceptions during
formatting. Test valid and invalid errors settings.
* t/text-options.t: Likewise.
* lib/Pod/Man.pm (cmd_l): Add nourls option to suppress the URL
from L<> formatting codes that contain anchor text. (#62210)
* lib/Pod/Text.pm (cmd_l): Likewise.
* scripts/pod2man: New --nourls option to set the corresponding
option in Pod::Man.
* scripts/pod2text: Likewise for Pod::Text.
* t/man-options.t: Test new nourls option.
* t/text-options.t: Likewise.
* lib/Pod/Man.pm (outindex): Also collapse consecutive whitespace
in index term text.
* t/man.t: Test for handling of index terms containing whitespace.
2013-01-02 Kevin Ryde <user42@zip.com.au>
* lib/Pod/Man.pm (outindex): Remove newlines from index term text
since *roff quotes don't span lines. (#82332)
2012-06-01 Russ Allbery <rra@stanford.edu>
* VERSION: podlators 2.4.2 released.
* t/text-encoding.t: Remove the test of a POD document without an
encoding. We previously tested that this interpreted the document
as ISO 8859-1, but Pod::Simple behavior has changed so that the
test started failing, plus Pod::Simple now warns about a missing
=encoding. (#77553)
Diffstat (limited to 'cpan/podlators/scripts')
-rw-r--r-- | cpan/podlators/scripts/pod2man.PL | 81 | ||||
-rw-r--r-- | cpan/podlators/scripts/pod2text.PL | 78 |
2 files changed, 111 insertions, 48 deletions
diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL index 4636601439..6af3474d35 100644 --- a/cpan/podlators/scripts/pod2man.PL +++ b/cpan/podlators/scripts/pod2man.PL @@ -37,7 +37,7 @@ print OUT <<'!NO!SUBS!'; # pod2man -- Convert POD data to formatted *roff input. # -# Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012 +# Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013 # Russ Allbery <rra@stanford.edu> # # This program is free software; you may redistribute it and/or modify it @@ -62,12 +62,12 @@ my $stdin; # Parse our options, trying to retain backward compatibility with pod2man but # allowing short forms as well. --lax is currently ignored. my %options; -$options{errors} = 'pod'; Getopt::Long::config ('bundling_override'); -GetOptions (\%options, 'center|c=s', 'date|d=s', 'fixed=s', 'fixedbold=s', - 'fixeditalic=s', 'fixedbolditalic=s', 'help|h', 'lax|l', - 'name|n=s', 'official|o', 'quotes|q=s', 'release|r:s', - 'section|s=s', 'stderr', 'verbose|v', 'utf8|u') or exit 1; +GetOptions (\%options, 'center|c=s', 'date|d=s', 'errors=s', 'fixed=s', + 'fixedbold=s', 'fixeditalic=s', 'fixedbolditalic=s', 'help|h', + 'lax|l', 'name|n=s', 'nourls', 'official|o', 'quotes|q=s', + 'release|r:s', 'section|s=s', 'stderr', 'verbose|v', 'utf8|u') + or exit 1; pod2usage (0) if $options{help}; # Official sets --center, but don't override things explicitly set. @@ -83,6 +83,11 @@ delete $options{verbose}; # compatibility. delete $options{lax}; +# If neither stderr nor errors is set, default to errors = die. +if (!defined $options{stderr} && !defined $options{errors}) { + $options{errors} = 'die'; +} + # Initialize and run the formatter, pulling a pair of input and output off at # a time. For each file, we check whether the document was completely empty # and, if so, will remove the created file and exit with a non-zero exit @@ -106,20 +111,20 @@ exit $status; __END__ +=for stopwords +en em --stderr stderr --utf8 UTF-8 overdo markup MT-LEVEL Allbery Solaris +URL troff troff-specific formatters uppercased Christiansen --nourls + =head1 NAME pod2man - Convert POD data to formatted *roff input -=for stopwords -en em --stderr stderr --utf8 UTF-8 overdo markup MT-LEVEL Allbery Solaris -URL troff troff-specific formatters uppercased Christiansen - =head1 SYNOPSIS -pod2man [B<--center>=I<string>] [B<--date>=I<string>] +pod2man [B<--center>=I<string>] [B<--date>=I<string>] [B<--errors>=I<style>] [B<--fixed>=I<font>] [B<--fixedbold>=I<font>] [B<--fixeditalic>=I<font>] - [B<--fixedbolditalic>=I<font>] [B<--name>=I<name>] [B<--official>] - [B<--quotes>=I<quotes>] [B<--release>[=I<version>]] + [B<--fixedbolditalic>=I<font>] [B<--name>=I<name>] [B<--nourls>] + [B<--official>] [B<--quotes>=I<quotes>] [B<--release>[=I<version>]] [B<--section>=I<manext>] [B<--stderr>] [B<--utf8>] [B<--verbose>] [I<input> [I<output>] ...] @@ -173,6 +178,16 @@ Set the left-hand footer string to this value. By default, the modification date of the input file will be used, or the current date if input comes from C<STDIN>. +=item B<-errors>=I<style> + +Set the error handling style. C<die> says to throw an exception on any +POD formatting error. C<stderr> says to report errors on standard error, +but not to throw an exception. C<pod> says to include a POD ERRORS +section in the resulting documentation summarizing the errors. C<none> +ignores POD errors entirely, as much as possible. + +The default is C<die>. + =item B<--fixed>=I<font> The fixed-width font to use for verbatim text and code. Defaults to @@ -220,6 +235,21 @@ Note that this option is probably not useful when converting multiple POD files at once. The convention for Unix man pages for commands is for the man page title to be in all-uppercase even if the command isn't. +=item B<--nourls> + +Normally, LZ<><> formatting codes with a URL but anchor text are formatted +to show both the anchor text and the URL. In other words: + + L<foo|http://example.com/> + +is formatted as: + + foo <http://example.com/> + +This flag, if given, suppresses the URL when anchor text is given, so this +example would be formatted as just C<foo>. This can produce less +cluttered output in cases where the URLs are not particularly important. + =item B<-o>, B<--official> Set the default header to indicate that this page is part of the standard @@ -262,10 +292,10 @@ which case section 3 will be selected. =item B<--stderr> -By default, B<pod2man> puts any errors detected in the POD input in a POD -ERRORS section in the output manual page. If B<--stderr> is given, errors -are sent to standard error instead and the POD ERRORS section is -suppressed. +By default, B<pod2man> dies if any errors are detected in the POD input. +If B<--stderr> is given and no B<--errors> flag is present, errors are +sent to standard error, but B<pod2man> does not abort. This is equivalent +to C<--errors=stderr> and is supported for backward compatibility. =item B<-u>, B<--utf8> @@ -298,16 +328,17 @@ Print out the name of each output file as it is being generated. =head1 EXIT STATUS As long as all documents processed result in some output, even if that -output includes errata (a C<POD ERRORS> section), B<pod2man> will exit -with status 0. If any of the documents being processed do not result -in an output document, B<pod2man> will exit with status 1. +output includes errata (a C<POD ERRORS> section generated with +C<--errors=pod>), B<pod2man> will exit with status 0. If any of the +documents being processed do not result in an output document, B<pod2man> +will exit with status 1. If there are syntax errors in a POD document +being processed and the error handling style is set to the default of +C<die>, B<pod2man> will abort immediately with exit status 255. =head1 DIAGNOSTICS If B<pod2man> fails with errors, see L<Pod::Man> and L<Pod::Simple> for -information about what those errors might mean. Most POD formatting -errors will be reported in a C<POD ERRORS> section of the generated -document. +information about what those errors might mean. =head1 EXAMPLES @@ -352,8 +383,8 @@ B<pod2man> by Larry Wall and Tom Christiansen. =head1 COPYRIGHT AND LICENSE -Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012 Russ Allbery -<rra@stanford.edu>. +Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013 Russ +Allbery <rra@stanford.edu>. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/podlators/scripts/pod2text.PL b/cpan/podlators/scripts/pod2text.PL index 2ec28d40bf..f1acdbe744 100644 --- a/cpan/podlators/scripts/pod2text.PL +++ b/cpan/podlators/scripts/pod2text.PL @@ -37,7 +37,7 @@ print OUT <<'!NO!SUBS!'; # pod2text -- Convert POD data to formatted ASCII text. # -# Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012 +# Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013 # Russ Allbery <rra@stanford.edu> # # This program is free software; you may redistribute it and/or modify it @@ -78,10 +78,10 @@ my $stdin; my %options; $options{sentence} = 0; Getopt::Long::config ('bundling'); -GetOptions (\%options, 'alt|a', 'code', 'color|c', 'help|h', 'indent|i=i', - 'loose|l', 'margin|left-margin|m=i', 'overstrike|o', - 'quotes|q=s', 'sentence|s', 'stderr', 'termcap|t', 'utf8|u', - 'width|w=i') +GetOptions (\%options, 'alt|a', 'code', 'color|c', 'errors=s', 'help|h', + 'indent|i=i', 'loose|l', 'margin|left-margin|m=i', 'nourls', + 'overstrike|o', 'quotes|q=s', 'sentence|s', 'stderr', 'termcap|t', + 'utf8|u', 'width|w=i') or exit 1; pod2usage (1) if $options{help}; @@ -101,6 +101,11 @@ if ($options{color}) { } delete @options{'color', 'termcap', 'overstrike'}; +# If neither stderr nor errors is set, default to errors = die. +if (!defined $options{stderr} && !defined $options{errors}) { + $options{errors} = 'die'; +} + # Initialize and run the formatter. my $parser = $formatter->new (%options); my $status = 0; @@ -119,18 +124,19 @@ exit $status; __END__ +=for stopwords +-aclostu --alt --stderr Allbery --overstrike overstrike --termcap --utf8 +UTF-8 subclasses --nourls + =head1 NAME pod2text - Convert POD data to formatted ASCII text -=for stopwords --aclostu --alt --stderr Allbery --overstrike overstrike --termcap --utf8 -UTF-8 subclasses - =head1 SYNOPSIS -pod2text [B<-aclostu>] [B<--code>] [B<-i> I<indent>] S<[B<-q> I<quotes>]> - [B<--stderr>] S<[B<-w> I<width>]> [I<input> [I<output> ...]] +pod2text [B<-aclostu>] [B<--code>] [B<--errors>=I<style>] [B<-i> I<indent>] + S<[B<-q> I<quotes>]> [B<--nourls>] [B<--stderr>] S<[B<-w> I<width>]> + [I<input> [I<output> ...]] pod2text B<-h> @@ -173,6 +179,16 @@ requires that Term::ANSIColor be installed on your system. Set the number of spaces to indent regular text, and the default indentation for C<=over> blocks. Defaults to 4 spaces if this option isn't given. +=item B<-errors>=I<style> + +Set the error handling style. C<die> says to throw an exception on any +POD formatting error. C<stderr> says to report errors on standard error, +but not to throw an exception. C<pod> says to include a POD ERRORS +section in the resulting documentation summarizing the errors. C<none> +ignores POD errors entirely, as much as possible. + +The default is C<die>. + =item B<-h>, B<--help> Print out usage information and exit. @@ -190,6 +206,21 @@ The width of the left margin in spaces. Defaults to 0. This is the margin for all text, including headings, not the amount by which regular text is indented; for the latter, see B<-i> option. +=item B<--nourls> + +Normally, LZ<><> formatting codes with a URL but anchor text are formatted +to show both the anchor text and the URL. In other words: + + L<foo|http://example.com/> + +is formatted as: + + foo <http://example.com/> + +This flag, if given, suppresses the URL when anchor text is given, so this +example would be formatted as just C<foo>. This can produce less +cluttered output in cases where the URLs are not particularly important. + =item B<-o>, B<--overstrike> Format the output with overstrike printing. Bold text is rendered as @@ -217,10 +248,11 @@ is compressed into a single space. =item B<--stderr> -By default, B<pod2text> puts any errors detected in the POD input in a POD -ERRORS section in the output manual page. If B<--stderr> is given, errors -are sent to standard error instead and the POD ERRORS section is -suppressed. +By default, B<pod2text> dies if any errors are detected in the POD input. +If B<--stderr> is given and no B<--errors> flag is present, errors are +sent to standard error, but B<pod2text> does not abort. This is +equivalent to C<--errors=stderr> and is supported for backward +compatibility. =item B<-t>, B<--termcap> @@ -255,9 +287,12 @@ your terminal device. =head1 EXIT STATUS As long as all documents processed result in some output, even if that -output includes errata (a C<POD ERRORS> section), B<pod2text> will exit -with status 0. If any of the documents being processed do not result -in an output document, B<pod2text> will exit with status 1. +output includes errata (a C<POD ERRORS> section generated with +C<--errors=pod>), B<pod2text> will exit with status 0. If any of the +documents being processed do not result in an output document, B<pod2text> +will exit with status 1. If there are syntax errors in a POD document +being processed and the error handling style is set to the default of +C<die>, B<pod2text> will abort immediately with exit status 255. =head1 DIAGNOSTICS @@ -281,9 +316,6 @@ loaded. In addition, other L<Getopt::Long> error messages may result from invalid command-line options. -Most POD formatting errors will be reported in a C<POD ERRORS> section of -the generated document. - =head1 ENVIRONMENT =over 4 @@ -317,8 +349,8 @@ Russ Allbery <rra@stanford.edu>. =head1 COPYRIGHT AND LICENSE -Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012 Russ Allbery -<rra@stanford.edu>. +Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013 Russ +Allbery <rra@stanford.edu>. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. |