diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2022-03-14 10:08:50 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2022-03-14 10:08:50 +0000 |
commit | 49b9d8ffc05bf0c271287eb1390cabad28c6a47a (patch) | |
tree | e2e1779b1d4795d6b2c3bf92a4e2e4154d82124b /Master/tlpkg/tlperl/lib/Pod | |
parent | f03a75ebd3b935ecde4dde32687fbe86161c30ed (diff) |
New tlperl 5.34
git-svn-id: svn://tug.org/texlive/trunk@62701 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod')
31 files changed, 282 insertions, 94 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/Checker.pm b/Master/tlpkg/tlperl/lib/Pod/Checker.pm index 0d18aaedb10..bee20d0bfad 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Checker.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Checker.pm @@ -10,7 +10,7 @@ package Pod::Checker; use strict; use warnings; -our $VERSION = '1.73'; ## Current version of this package +our $VERSION = '1.74'; ## Current version of this package =head1 NAME @@ -197,10 +197,6 @@ The I<STRING> found cannot be interpreted as a character entity. There needs to be content inside E, L, and X formatting codes. -=item * A non-empty ZE<lt>E<gt> - -The C<ZE<lt>E<gt>> sequence is supposed to be empty. - =item * Spurious text after =pod / =cut The commands C<=pod> and C<=cut> do not take any arguments. @@ -299,6 +295,12 @@ description of what the thing is good for. For example if there is a C<=head2> in the POD file prior to a C<=head1>. +=item * A non-empty ZE<lt>E<gt> + +The C<ZE<lt>E<gt>> sequence is supposed to be empty. Caveat: this issue is +detected in L<Pod::Simple> and will be flagged as an I<ERROR> by any client +code; any contents of C<ZE<lt>...E<gt>> will be disregarded, anyway. + =back =head2 Hyperlinks @@ -361,11 +363,122 @@ B<podchecker> (the script). This allows users of B<Pod::Checker> to control completely the output behavior. Users of B<podchecker> (the script) get the well-known behavior. -v1.45 inherits from Pod::Simple as opposed to all previous versions +v1.45 inherits from L<Pod::Simple> as opposed to all previous versions inheriting from Pod::Parser. Do B<not> use Pod::Simple's interface when using Pod::Checker unless it is documented somewhere on this page. I repeat, DO B<NOT> USE POD::SIMPLE'S INTERFACE. +The following list documents the overrides to Pod::Simple, primarily to +make L<Pod::Coverage> happy: + +=over 4 + +=item end_B + +=item end_C + +=item end_Document + +=item end_F + +=item end_I + +=item end_L + +=item end_Para + +=item end_S + +=item end_X + +=item end_fcode + +=item end_for + +=item end_head + +=item end_head1 + +=item end_head2 + +=item end_head3 + +=item end_head4 + +=item end_item + +=item end_item_bullet + +=item end_item_number + +=item end_item_text + +=item handle_pod_and_cut + +=item handle_text + +=item handle_whiteline + +=item hyperlink + +=item scream + +=item start_B + +=item start_C + +=item start_Data + +=item start_F + +=item start_I + +=item start_L + +=item start_Para + +=item start_S + +=item start_Verbatim + +=item start_X + +=item start_fcode + +=item start_for + +=item start_head + +=item start_head1 + +=item start_head2 + +=item start_head3 + +=item start_head4 + +=item start_item_bullet + +=item start_item_number + +=item start_item_text + +=item start_over + +=item start_over_block + +=item start_over_bullet + +=item start_over_empty + +=item start_over_number + +=item start_over_text + +=item whine + +=back + =cut ############################################################################# @@ -663,6 +776,9 @@ sub whine { $complaint =~ /^You have '=item .+?' instead of the expected '=item .+?'$/; } + # rt.cpan.org #98326 - errors about Z<> ("non-empty") + $severity = 'WARNING' if $complaint =~ /\bZ\<\>/; + $self->poderror({ -line => $line, -severity => $severity, -msg => $complaint }); diff --git a/Master/tlpkg/tlperl/lib/Pod/Html.pm b/Master/tlpkg/tlperl/lib/Pod/Html.pm index 71555e723ca..ba0ab0b39ac 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Html.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Html.pm @@ -2,7 +2,7 @@ package Pod::Html; use strict; require Exporter; -our $VERSION = 1.25; +our $VERSION = 1.27; our @ISA = qw(Exporter); our @EXPORT = qw(pod2html htmlify); our @EXPORT_OK = qw(anchorify relativize_url); @@ -16,6 +16,7 @@ use File::Spec::Unix; use Getopt::Long; use Pod::Simple::Search; use Pod::Simple::SimpleTree (); +use Text::Tabs; use locale; # make \w work right in non-ASCII lands =head1 NAME @@ -257,8 +258,6 @@ my %Pages = (); # associative array used to find the location my $Curdir = File::Spec->curdir; -init_globals(); - sub init_globals { $Cachedir = "."; # The directory to which directory caches # will be written. @@ -367,6 +366,9 @@ sub pod2html { # set options for input parser my $parser = Pod::Simple::SimpleTree->new; + # Normalize whitespace indenting + $parser->strip_verbatim_indent(\&trim_leading_whitespace); + $parser->codes_in_verbatim(0); $parser->accept_targets(qw(html HTML)); $parser->no_errata_section(!$Poderrors); # note the inverse @@ -579,13 +581,12 @@ my $Saved_Cache_Key; sub get_cache { my($dircache, $podpath, $podroot, $recurse) = @_; - my @cache_key_args = @_; # A first-level cache: # Don't bother reading the cache files if they still apply # and haven't changed since we last read them. - my $this_cache_key = cache_key(@cache_key_args); + my $this_cache_key = cache_key($dircache, $podpath, $podroot, $recurse); return 1 if $Saved_Cache_Key and $this_cache_key eq $Saved_Cache_Key; $Saved_Cache_Key = $this_cache_key; @@ -842,4 +843,24 @@ sub relativize_url { return $rel_path; } +# Remove any level of indentation (spaces or tabs) from each code block consistently +# Adapted from: https://metacpan.org/source/HAARG/MetaCPAN-Pod-XHTML-0.002001/lib/Pod/Simple/Role/StripVerbatimIndent.pm +sub trim_leading_whitespace { + my ($para) = @_; + + # Start by converting tabs to spaces + @$para = Text::Tabs::expand(@$para); + + # Find the line with the least amount of indent, as that's our "base" + my @indent_levels = (sort(map { $_ =~ /^( *)./mg } @$para)); + my $indent = $indent_levels[0] || ""; + + # Remove the "base" amount of indent from each line + foreach (@$para) { + $_ =~ s/^\Q$indent//mg; + } + + return; +} + 1; diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple.pm b/Master/tlpkg/tlperl/lib/Pod/Simple.pm index 6c91b8ac1fb..f2544d0ef10 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple.pm @@ -18,11 +18,11 @@ use vars qw( ); @ISA = ('Pod::Simple::BlackBox'); -$VERSION = '3.40'; +$VERSION = '3.42'; @Known_formatting_codes = qw(I B C L E F S X Z); %Known_formatting_codes = map(($_=>1), @Known_formatting_codes); -@Known_directives = qw(head1 head2 head3 head4 item over back); +@Known_directives = qw(head1 head2 head3 head4 head5 head6 item over back); %Known_directives = map(($_=>'Plain'), @Known_directives); $NL = $/ unless defined $NL; diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm index d115aee7e3e..03dede7c34c 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm @@ -22,7 +22,7 @@ use integer; # vroom! use strict; use Carp (); use vars qw($VERSION ); -$VERSION = '3.40'; +$VERSION = '3.42'; #use constant DEBUG => 7; sub my_qr ($$) { @@ -64,7 +64,7 @@ my $non_ascii_re = my_qr('[[:^ascii:]]', "\xB6"); $non_ascii_re = qr/[\x80-\xFF]/ unless $non_ascii_re; # Use patterns understandable by Perl 5.6, if possible -my $cs_re = my_qr('\p{IsCs}', "\x{D800}"); +my $cs_re = do { no warnings; my_qr('\p{IsCs}', "\x{D800}") }; my $cn_re = my_qr('\p{IsCn}', "\x{09E4}"); # <reserved> code point unlikely # to get assigned my $rare_blocks_re = my_qr('[\p{InIPAExtensions}\p{InSpacingModifierLetters}]', @@ -139,10 +139,8 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines) # An attempt to match the pod portions of a line. This is not fool proof, # but is good enough to serve as part of the heuristic for guessing the pod # encoding if not specified. - my $format_codes = join "", '[', grep { / ^ [A-Za-z] $/x } - keys %{$self->{accept_codes}}; - $format_codes .= ']'; - my $pod_chars_re = qr/ ^ = [A-Za-z]+ | $format_codes < /x; + my $codes = join '', grep { / ^ [A-Za-z] $/x } sort keys %{$self->{accept_codes}}; + my $pod_chars_re = qr/ ^ = [A-Za-z]+ | [\Q$codes\E] < /x; my $line; foreach my $source_line (@_) { diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm index 2fef0305a5c..65f4d54243f 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm @@ -9,7 +9,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '3.40'; +$VERSION = '3.42'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm index aaa5a887e6b..6b9aa327c01 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm @@ -2,7 +2,7 @@ require 5; package Pod::Simple::Debug; use strict; use vars qw($VERSION ); -$VERSION = '3.40'; +$VERSION = '3.42'; sub import { my($value,$variable); diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm index bade6fcc472..a22603043bd 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsText; -$VERSION = '3.40'; +$VERSION = '3.42'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm index 6f0b7b18621..024e4b7b819 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsXML; -$VERSION = '3.40'; +$VERSION = '3.42'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm index 0219b979100..f930a512172 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm @@ -9,7 +9,7 @@ use vars qw( $Doctype_decl $Content_decl ); @ISA = ('Pod::Simple::PullParser'); -$VERSION = '3.40'; +$VERSION = '3.42'; BEGIN { if(defined &DEBUG) { } # no-op elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG } @@ -109,10 +109,14 @@ my @_to_accept; 'head2' => "\n<h2>", # '' 'head3' => "\n<h3>", # '' 'head4' => "\n<h4>", # '' + 'head5' => "\n<h5>", # '' + 'head6' => "\n<h6>", # '' '/head1' => "</a></h1>\n", '/head2' => "</a></h2>\n", '/head3' => "</a></h3>\n", '/head4' => "</a></h4>\n", + '/head5' => "</a></h5>\n", + '/head6' => "</a></h6>\n", 'X' => "<!--\n\tINDEX: ", '/X' => "\n-->", @@ -224,7 +228,7 @@ sub __adjust_html_h_levels { return if ($self->{'Adjusted_html_h_levels'}||0) == $add; $add -= 1; - for (1 .. 4) { + for (1 .. 6) { $Tagmap->{"head$_"} =~ s/$_/$_ + $add/e; $Tagmap->{"/head$_"} =~ s/$_/$_ + $add/e; } @@ -323,7 +327,7 @@ sub version_tag_comment { "<!--\n generated by %s v%s,\n using %s v%s,\n under Perl v%s at %s GMT.\n\n %s\n\n-->\n", esc( ref($self), $self->VERSION(), $ISA[0], $ISA[0]->VERSION(), - $], scalar(gmtime), + $], scalar(gmtime($ENV{SOURCE_DATE_EPOCH} || time)), ), $self->_modnote(), ; } diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm index 227d6d3af0d..6a06173f471 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm @@ -5,7 +5,7 @@ use strict; use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION $CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA ); -$VERSION = '3.40'; +$VERSION = '3.42'; @ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML! # TODO: nocontents stylesheets. Strike some of the color variations? @@ -94,11 +94,11 @@ sub new { $new->contents_page_end( sprintf( - "\n\n<p class='contentsfooty'>Generated by %s v%s under Perl v%s\n<br >At %s GMT, which is %s local time.</p>\n\n</body></html>\n", + "\n\n<p class='contentsfooty'>Generated by %s v%s under Perl v%s\n<br >At %s GMT.</p>\n\n</body></html>\n", esc( ref($new), eval {$new->VERSION} || $VERSION, - $], scalar(gmtime), scalar(localtime), + $], scalar(gmtime($ENV{SOURCE_DATE_EPOCH} || time)), ))); return $new; @@ -871,7 +871,8 @@ $CSS = <<'EOCSS'; background-color: #000; } - body.pod h1, body.pod h2, body.pod h3, body.pod h4 { + body.pod h1, body.pod h2, body.pod h3, + body.pod h4, body.pod h5, body.pod h6 { font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; font-weight: normal; margin-top: 1.2em; @@ -884,11 +885,15 @@ $CSS = <<'EOCSS'; body.pod h2 { border-top-color: #080; } body.pod h3 { border-top-color: #040; } body.pod h4 { border-top-color: #010; } + body.pod h5 { border-top-color: #010; } + body.pod h6 { border-top-color: #010; } p.backlinktop + h1 { border-top: none; margin-top: 0em; } p.backlinktop + h2 { border-top: none; margin-top: 0em; } p.backlinktop + h3 { border-top: none; margin-top: 0em; } p.backlinktop + h4 { border-top: none; margin-top: 0em; } + p.backlinktop + h5 { border-top: none; margin-top: 0em; } + p.backlinktop + h6 { border-top: none; margin-top: 0em; } body.pod dt { font-size: 105%; /* just a wee bit more than normal */ diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/JustPod.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/JustPod.pm index c7ad3d69770..935c9e82821 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/JustPod.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/JustPod.pm @@ -74,6 +74,8 @@ sub start_head1 { shift->_generic_start('=head1', @_); } sub start_head2 { shift->_generic_start('=head2', @_); } sub start_head3 { shift->_generic_start('=head3', @_); } sub start_head4 { shift->_generic_start('=head4', @_); } +sub start_head5 { shift->_generic_start('=head5', @_); } +sub start_head6 { shift->_generic_start('=head6', @_); } sub start_encoding { shift->_generic_start('=encoding', @_); } # sub start_Para # sub start_Verbatim @@ -175,6 +177,8 @@ sub _end_generic { *end_head2 = *_end_generic; *end_head3 = *_end_generic; *end_head4 = *_end_generic; +*end_head5 = *_end_generic; +*end_head6 = *_end_generic; *end_encoding = *_end_generic; *end_Para = *_end_generic; *end_Verbatim = *_end_generic; diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm index b9ca19cdf93..a6898caec43 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm @@ -6,7 +6,7 @@ package Pod::Simple::LinkSection; use strict; use Pod::Simple::BlackBox; use vars qw($VERSION ); -$VERSION = '3.40'; +$VERSION = '3.42'; use overload( # So it'll stringify nice '""' => \&Pod::Simple::BlackBox::stringify_lol, diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Methody.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Methody.pm index 5bcee54d4f7..45e26cf4637 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/Methody.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Methody.pm @@ -4,7 +4,7 @@ package Pod::Simple::Methody; use strict; use Pod::Simple (); use vars qw(@ISA $VERSION); -$VERSION = '3.40'; +$VERSION = '3.42'; @ISA = ('Pod::Simple'); # Yes, we could use named variables, but I want this to be impose diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm index 3d6f4031125..77de9ae86f4 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::Progress; -$VERSION = '3.40'; +$VERSION = '3.42'; use strict; # Objects of this class are used for noting progress of an diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm index ceeb3f92504..57aad9ac085 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm @@ -1,6 +1,6 @@ require 5; package Pod::Simple::PullParser; -$VERSION = '3.40'; +$VERSION = '3.42'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm index d9ebdcbcf0e..dbff3df249d 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.40'; +$VERSION = '3.42'; sub new { # Class->new(tagname); my $class = shift; diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserStartToken.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserStartToken.pm index 61608fb466c..1ab33cc6e0a 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserStartToken.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserStartToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.40'; +$VERSION = '3.42'; sub new { # Class->new(tagname, optional_attrhash); my $class = shift; diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserTextToken.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserTextToken.pm index c8247a081e7..cdce959db4b 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserTextToken.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserTextToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.40'; +$VERSION = '3.42'; sub new { # Class->new(text); my $class = shift; diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserToken.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserToken.pm index f14b5637cd4..63a2dabe6f3 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserToken.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserToken.pm @@ -3,7 +3,7 @@ require 5; package Pod::Simple::PullParserToken; # Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token @ISA = (); -$VERSION = '3.40'; +$VERSION = '3.42'; use strict; sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/RTF.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/RTF.pm index ed0de149ae0..10e05c5d0a4 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/RTF.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/RTF.pm @@ -8,7 +8,7 @@ package Pod::Simple::RTF; use strict; use vars qw($VERSION @ISA %Escape $WRAP %Tagmap); -$VERSION = '3.40'; +$VERSION = '3.42'; use Pod::Simple::PullParser (); BEGIN {@ISA = ('Pod::Simple::PullParser')} @@ -494,7 +494,7 @@ END # None of the following things should need escaping, I dare say! $tag, $ISA[0], $ISA[0]->VERSION(), - $], scalar(gmtime), + $], scalar(gmtime($ENV{SOURCE_DATE_EPOCH} || time)), ; } diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm index a07d33b85ac..ad610654c99 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm @@ -3,7 +3,7 @@ package Pod::Simple::Search; use strict; use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY); -$VERSION = '3.40'; ## Current version of this package +$VERSION = '3.42'; ## Current version of this package BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level use Carp (); diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm index 85dbabcd70e..38a2704f876 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm @@ -5,7 +5,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '3.40'; +$VERSION = '3.42'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm index de50b510eae..2f0254ec37d 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm @@ -6,7 +6,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION $FREAKYMODE); -$VERSION = '3.40'; +$VERSION = '3.42'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm index ad4172b7a31..ccbf4242214 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm @@ -6,7 +6,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '3.40'; +$VERSION = '3.42'; @ISA = ('Pod::Simple'); sub new { diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm index 0dd12c412dd..cbf58b37069 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm @@ -4,7 +4,7 @@ package Pod::Simple::TiedOutFH; use Symbol ('gensym'); use Carp (); use vars qw($VERSION ); -$VERSION = '3.40'; +$VERSION = '3.42'; #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm index eb127022827..bdb7181af64 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm @@ -3,7 +3,7 @@ require 5; package Pod::Simple::Transcode; use strict; use vars qw($VERSION @ISA); -$VERSION = '3.40'; +$VERSION = '3.42'; BEGIN { if(defined &DEBUG) {;} # Okay diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm index 2b675ccb787..96e6a544102 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm @@ -5,7 +5,7 @@ require 5; package Pod::Simple::TranscodeDumb; use strict; use vars qw($VERSION %Supported); -$VERSION = '3.40'; +$VERSION = '3.42'; # This module basically pretends it knows how to transcode, except # only for null-transcodings! We use this when Encode isn't # available. diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm index 99f55683ab3..3f3224f917b 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm @@ -9,7 +9,7 @@ use strict; use Pod::Simple; require Encode; use vars qw($VERSION ); -$VERSION = '3.40'; +$VERSION = '3.42'; sub is_dumb {0} sub is_smart {1} diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/XHTML.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/XHTML.pm index b9c6269bf98..9049ce755ff 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/XHTML.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/XHTML.pm @@ -45,7 +45,7 @@ declare the output character set as UTF-8 before parsing, like so: package Pod::Simple::XHTML; use strict; use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES ); -$VERSION = '3.40'; +$VERSION = '3.42'; use Pod::Simple::Methody (); @ISA = ('Pod::Simple::Methody'); @@ -400,6 +400,8 @@ sub start_head1 { $_[0]{'in_head'} = 1; $_[0]{htext} = ''; } sub start_head2 { $_[0]{'in_head'} = 2; $_[0]{htext} = ''; } sub start_head3 { $_[0]{'in_head'} = 3; $_[0]{htext} = ''; } sub start_head4 { $_[0]{'in_head'} = 4; $_[0]{htext} = ''; } +sub start_head5 { $_[0]{'in_head'} = 5; $_[0]{htext} = ''; } +sub start_head6 { $_[0]{'in_head'} = 6; $_[0]{htext} = ''; } sub start_item_number { $_[0]{'scratch'} = "</li>\n" if ($_[0]{'in_li'}->[-1] && pop @{$_[0]{'in_li'}}); @@ -483,6 +485,8 @@ sub end_head1 { shift->_end_head(@_); } sub end_head2 { shift->_end_head(@_); } sub end_head3 { shift->_end_head(@_); } sub end_head4 { shift->_end_head(@_); } +sub end_head5 { shift->_end_head(@_); } +sub end_head6 { shift->_end_head(@_); } sub end_item_bullet { $_[0]{'scratch'} .= '</p>'; $_[0]->emit } sub end_item_number { $_[0]{'scratch'} .= '</p>'; $_[0]->emit } diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm index cb818a17409..a891a3341f5 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm @@ -5,7 +5,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '3.40'; +$VERSION = '3.42'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; diff --git a/Master/tlpkg/tlperl/lib/Pod/Usage.pm b/Master/tlpkg/tlperl/lib/Pod/Usage.pm index 8f7985040f3..c290f2baf1e 100644 --- a/Master/tlpkg/tlperl/lib/Pod/Usage.pm +++ b/Master/tlpkg/tlperl/lib/Pod/Usage.pm @@ -9,19 +9,19 @@ ############################################################################# package Pod::Usage; -use strict; -use vars qw($VERSION @ISA @EXPORT); -$VERSION = '1.69'; ## Current version of this package +use strict; require 5.006; ## requires this Perl version or later -#use diagnostics; use Carp; use Config; use Exporter; use File::Spec; -@EXPORT = qw(&pod2usage); +our $VERSION = '2.01'; + +our @EXPORT = qw(&pod2usage); +our @ISA; BEGIN { $Pod::Usage::Formatter ||= 'Pod::Text'; eval "require $Pod::Usage::Formatter"; @@ -103,13 +103,13 @@ sub pod2usage { my @paths = (ref $pathspec) ? @$pathspec : split($pathsep, $pathspec); for my $dirname (@paths) { - $_ = File::Spec->catfile($dirname, $basename) if length; + $_ = length($dirname) ? File::Spec->catfile($dirname, $basename) : $basename; last if (-e $_) && ($opts{'-input'} = $_); } } ## Now create a pod reader and constrain it to the desired sections. - my $parser = new Pod::Usage(USAGE_OPTIONS => \%opts); + my $parser = Pod::Usage->new(USAGE_OPTIONS => \%opts); if ($opts{'-verbose'} == 0) { $parser->select('(?:SYNOPSIS|USAGE)\s*'); } @@ -130,8 +130,8 @@ sub pod2usage { ## Check for perldoc my $progpath = $opts{'-perldoc'} ? $opts{'-perldoc'} : - File::Spec->catfile($Config{scriptdirexp} - || $Config{scriptdir}, 'perldoc'); + File::Spec->catfile($Config{scriptdirexp} || $Config{scriptdir}, + 'perldoc'); my $version = sprintf("%vd",$^V); if ($Config{versiononly} and $Config{startperl} =~ /\Q$version\E$/ ) { @@ -159,9 +159,17 @@ sub pod2usage { push @perldoc_cmd, ('-F', $f); unshift @perldoc_cmd, $opts{'-perlcmd'} if $opts{'-perlcmd'}; system(@perldoc_cmd); + # RT16091: fall back to more if perldoc failed if($?) { - # RT16091: fall back to more if perldoc failed - system(($Config{pager} || $ENV{PAGER} || '/bin/more'), $1); + # RT131844: prefer PAGER env + my $pager = $ENV{PAGER} || $Config{pager}; + if(defined($pager) && length($pager)) { + my $cmd = $pager . ' ' . ($^O =~ /win/i ? qq("$f") : quotemeta($f)); + system($cmd); + } else { + # the most humble fallback; should work (at least) on *nix and Win + system('more', $f); + } } } else { croak "Unspecified input file or insecure argument.\n"; @@ -275,7 +283,12 @@ sub select { sub seq_i { return $_[1] } # Override Pod::Text->cmd_i to return just "arg", not "*arg*". # newer version based on Pod::Simple -sub cmd_i { return $_[2] } +sub cmd_i { + my $self = shift; + # RT121489: highlighting should be there with Termcap + return $self->SUPER::cmd_i(@_) if $self->isa('Pod::Text::Termcap'); + return $_[1]; +} # This overrides the Pod::Text method to do something very akin to what # Pod::Select did as well as the work done below by preprocess_paragraph. @@ -373,13 +386,15 @@ sub preprocess_paragraph { __END__ +=for stopwords pod2usage verboseness downcased MSWin32 Marek Rouchal Christiansen ATOOMIC rjbs McDougall + =head1 NAME -Pod::Usage - print a usage message from embedded pod documentation +Pod::Usage - extracts POD documentation and shows usage information =head1 SYNOPSIS - use Pod::Usage + use Pod::Usage; my $message_text = "This text precedes the usage message."; my $exit_status = 2; ## The exit status to use @@ -391,13 +406,13 @@ Pod::Usage - print a usage message from embedded pod documentation pod2usage($exit_status); pod2usage( { -message => $message_text , - -exitval => $exit_status , - -verbose => $verbose_level, + -exitval => $exit_status , + -verbose => $verbose_level, -output => $filehandle } ); pod2usage( -msg => $message_text , - -exitval => $exit_status , - -verbose => $verbose_level, + -exitval => $exit_status , + -verbose => $verbose_level, -output => $filehandle ); pod2usage( -verbose => 2, @@ -443,39 +458,39 @@ keys: =item C<-msg> I<string> The text of a message to print immediately prior to printing the -program's usage message. +program's usage message. =item C<-exitval> I<value> The desired exit status to pass to the B<exit()> function. -This should be an integer, or else the string "NOEXIT" to +This should be an integer, or else the string C<NOEXIT> to indicate that control should simply be returned without terminating the invoking process. =item C<-verbose> I<value> The desired level of "verboseness" to use when printing the usage message. -If the value is 0, then only the "SYNOPSIS" section of the pod documentation -is printed. If the value is 1, then the "SYNOPSIS" section, along with any -section entitled "OPTIONS", "ARGUMENTS", or "OPTIONS AND ARGUMENTS" is -printed. If the corresponding value is 2 or more then the entire manpage is -printed, using L<perldoc> if available; otherwise L<Pod::Text> is used for -the formatting. For better readability, the all-capital headings are -downcased, e.g. C<SYNOPSIS> =E<gt> C<Synopsis>. +If the value is 0, then only the "SYNOPSIS" and/or "USAGE" sections of the +pod documentation are printed. If the value is 1, then the "SYNOPSIS" and/or +"USAGE" sections, along with any section entitled "OPTIONS", "ARGUMENTS", or +"OPTIONS AND ARGUMENTS" is printed. If the corresponding value is 2 or more +then the entire manpage is printed, using L<perldoc> if available; otherwise +L<Pod::Text> is used for the formatting. For better readability, the +all-capital headings are downcased, e.g. C<SYNOPSIS> =E<gt> C<Synopsis>. The special verbosity level 99 requires to also specify the -sections parameter; then these sections are extracted and printed. =item C<-sections> I<spec> -There are two ways to specify the selection. Either a string (scalar) +There are two ways to specify the selection. Either a string (scalar) representing a selection regexp for sections to be printed when -verbose is set to 99, e.g. "NAME|SYNOPSIS|DESCRIPTION|VERSION" With the above regexp all content following (and including) any of the -given C<=head1> headings will be shown. It is possible to restrict the +given C<=head1> headings will be shown. It is possible to restrict the output to particular subsections only, e.g.: "DESCRIPTION/Algorithm" @@ -484,7 +499,7 @@ This will output only the C<=head2 Algorithm> heading and content within the C<=head1 DESCRIPTION> section. The regexp binding is stronger than the section separator, such that e.g.: - "DESCRIPTION|OPTIONS|ENVIORNMENT/Caveats" + "DESCRIPTION|OPTIONS|ENVIRONMENT/Caveats" will print any C<=head2 Caveats> section (only) within any of the three C<=head1> sections. @@ -494,7 +509,7 @@ Alternatively, an array reference of section specifications can be used: pod2usage(-verbose => 99, -sections => [ qw(DESCRIPTION DESCRIPTION/Introduction) ] ); -This will print only the content of C<=head1 DESCRIPTION> and the +This will print only the content of C<=head1 DESCRIPTION> and the C<=head2 Introduction> sections, but no other C<=head2>, and no other C<=head1> either. @@ -528,17 +543,16 @@ MSWin32 and DOS). =item C<-noperldoc> -By default, Pod::Usage will call L<perldoc> when -verbose >= 2 is -specified. This does not work well e.g. if the script was packed -with L<PAR>. The -noperldoc option suppresses the external call to -L<perldoc> and uses the simple text formatter (L<Pod::Text>) to -output the POD. +By default, Pod::Usage will call L<perldoc> when -verbose >= 2 is specified. +This does not work well e.g. if the script was packed with L<PAR>. This option +suppresses the external call to L<perldoc> and uses the simple text formatter +(L<Pod::Text>) to output the POD. =item C<-perlcmd> By default, Pod::Usage will call L<perldoc> when -verbose >= 2 is specified. In case of special or unusual Perl installations, -the -perlcmd option may be used to supply the path to a L<perl> executable +this option may be used to supply the path to a L<perl> executable which should run L<perldoc>. =item C<-perldoc> I<path-to-perldoc> @@ -551,7 +565,7 @@ the correct path to L<perldoc>. =item C<-perldocopt> I<string> By default, Pod::Usage will call L<perldoc> when -verbose >= 2 is specified. -The -perldocopt option may be used to supply options to L<perldoc>. The +This option may be used to supply options to L<perldoc>. The string may contain several, space-separated options. =back @@ -659,7 +673,7 @@ more verbose description of program usage in this case. =back -B<pod2usage> doesn't force the above conventions upon you, but it will +B<pod2usage> does not force the above conventions upon you, but it will use them by default if you don't expressly tell it to do otherwise. The ability of B<pod2usage()> to accept a single number or a string makes it convenient to use as an innocent looking error message handling function: @@ -848,7 +862,7 @@ things: By default, B<pod2usage()> will use C<$0> as the path to the pod input file. Unfortunately, not all systems on which Perl runs will set C<$0> -properly (although if C<$0> isn't found, B<pod2usage()> will search +properly (although if C<$0> is not found, B<pod2usage()> will search C<$ENV{PATH}> or else the list specified by the C<-pathlist> option). If this is the case for your system, you may need to explicitly specify the path to the pod docs for the invoking script using something @@ -865,23 +879,45 @@ the script: use FindBin; pod2usage(-input => $FindBin::Bin . "/" . $FindBin::Script); -=head1 AUTHOR +=head1 SUPPORT -Please report bugs using L<http://rt.cpan.org>. +This module is managed in a GitHub repository, +L<https://github.com/Dual-Life/Pod-Usage> Feel free to fork and contribute, or +to clone and send patches! + +Please use L<https://github.com/Dual-Life/Pod-Usage/issues/new> to file a bug +report. The previous ticketing system, +L<https://rt.cpan.org/Dist/Display.html?Queue=Pod-Usage>, is deprecated for +this package. + +More general questions or discussion about POD should be sent to the +C<pod-people@perl.org> mail list. Send an empty email to +C<pod-people-subscribe@perl.org> to subscribe. + +=head1 AUTHOR Marek Rouchal E<lt>marekr@cpan.orgE<gt> +Nicolas R E<lt>nicolas@atoomic.orgE<gt> + Brad Appleton E<lt>bradapp@enteract.comE<gt> Based on code for B<Pod::Text::pod2text()> written by Tom Christiansen E<lt>tchrist@mox.perl.comE<gt> +=head1 LICENSE + +Pod::Usage (the distribution) is licensed under the same terms as Perl. + =head1 ACKNOWLEDGMENTS +Nicolas R (ATOOMIC) for setting up the Github repo and modernizing this +package. + rjbs for refactoring Pod::Usage to not use Pod::Parser any more. -Steven McDougall E<lt>swmcd@world.std.comE<gt> for his help and patience -with re-writing this manpage. +Steven McDougall E<lt>swmcd@world.std.comE<gt> for his help and patience with +re-writing this manpage. =head1 SEE ALSO |