summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Pod
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-10 21:56:14 +0000
committerKarl Berry <karl@freefriends.org>2019-03-10 21:56:14 +0000
commite0a2a718e89f9700d627f1e6a8eea8f21d2fbeb8 (patch)
tree39972f65008b0d70f306a5f976494d29411bc41e /Master/tlpkg/tlperl/lib/Pod
parentb206fdc77d81ed1600949062f08de5690a4bf66f (diff)
tl19 perl 5.28.1 for Windows, from Siep
git-svn-id: svn://tug.org/texlive/trunk@50322 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod')
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Functions.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Html.pm109
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Man.pm48
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/ParseLink.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc.pm12
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Text.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Text/Color.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Text/Overstrike.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Text/Termcap.pm2
9 files changed, 105 insertions, 80 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/Functions.pm b/Master/tlpkg/tlperl/lib/Pod/Functions.pm
index f71f6e375b1..f4e2a9464c4 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Functions.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Functions.pm
@@ -54,7 +54,7 @@ L<perlfunc/"Perl Functions by Category"> section.
=cut
-our $VERSION = '1.11';
+our $VERSION = '1.13';
require Exporter;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Html.pm b/Master/tlpkg/tlperl/lib/Pod/Html.pm
index 5b3463687b6..64cf376f3c9 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Html.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Html.pm
@@ -2,11 +2,10 @@ package Pod::Html;
use strict;
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-$VERSION = 1.2202;
-@ISA = qw(Exporter);
-@EXPORT = qw(pod2html htmlify);
-@EXPORT_OK = qw(anchorify);
+our $VERSION = 1.24;
+our @ISA = qw(Exporter);
+our @EXPORT = qw(pod2html htmlify);
+our @EXPORT_OK = qw(anchorify relativize_url);
use Carp;
use Config;
@@ -16,6 +15,7 @@ use File::Spec;
use File::Spec::Unix;
use Getopt::Long;
use Pod::Simple::Search;
+use Pod::Simple::SimpleTree ();
use locale; # make \w work right in non-ASCII lands
=head1 NAME
@@ -223,6 +223,19 @@ This program is distributed under the Artistic License.
=cut
+# This sub duplicates the guts of Pod::Simple::FromTree. We could have
+# used that module, except that it would have been a non-core dependency.
+sub feed_tree_to_parser {
+ my($parser, $tree) = @_;
+ if(ref($tree) eq "") {
+ $parser->_handle_text($tree);
+ } elsif(!($tree->[0] eq "X" && $parser->nix_X_codes)) {
+ $parser->_handle_element_start($tree->[0], $tree->[1]);
+ feed_tree_to_parser($parser, $_) foreach @{$tree}[2..$#$tree];
+ $parser->_handle_element_end($tree->[0]);
+ }
+}
+
my $Cachedir;
my $Dircache;
my($Htmlroot, $Htmldir, $Htmlfile, $Htmlfileurl);
@@ -274,7 +287,7 @@ sub init_globals {
$Doindex = 1; # non-zero if we should generate an index
$Backlink = 0; # no backlinks added by default
$Header = 0; # produce block header/footer
- $Title = ''; # title to give the pod(s)
+ $Title = undef; # title to give the pod(s)
}
sub pod2html {
@@ -340,25 +353,60 @@ sub pod2html {
close $cache or die "error closing $Dircache: $!";
}
- # set options for the parser
- my $parser = Pod::Simple::XHTML::LocalPodLinks->new();
+ my $input;
+ unless (@ARGV && $ARGV[0]) {
+ if ($Podfile and $Podfile ne '-') {
+ $input = $Podfile;
+ } else {
+ $input = '-'; # XXX: make a test case for this
+ }
+ } else {
+ $Podfile = $ARGV[0];
+ $input = *ARGV;
+ }
+
+ # set options for input parser
+ my $parser = Pod::Simple::SimpleTree->new;
+ $parser->codes_in_verbatim(0);
+ $parser->accept_targets(qw(html HTML));
+ $parser->no_errata_section(!$Poderrors); # note the inverse
+
+ warn "Converting input file $Podfile\n" if $Verbose;
+ my $podtree = $parser->parse_file($input)->root;
+
+ unless(defined $Title) {
+ if($podtree->[0] eq "Document" && ref($podtree->[2]) eq "ARRAY" &&
+ $podtree->[2]->[0] eq "head1" && @{$podtree->[2]} == 3 &&
+ ref($podtree->[2]->[2]) eq "" && $podtree->[2]->[2] eq "NAME" &&
+ ref($podtree->[3]) eq "ARRAY" && $podtree->[3]->[0] eq "Para" &&
+ @{$podtree->[3]} >= 3 &&
+ !(grep { ref($_) ne "" }
+ @{$podtree->[3]}[2..$#{$podtree->[3]}]) &&
+ (@$podtree == 4 ||
+ (ref($podtree->[4]) eq "ARRAY" &&
+ $podtree->[4]->[0] eq "head1"))) {
+ $Title = join("", @{$podtree->[3]}[2..$#{$podtree->[3]}]);
+ }
+ }
+
+ $Title //= "";
+ $Title = html_escape($Title);
+
+ # set options for the HTML generator
+ $parser = Pod::Simple::XHTML::LocalPodLinks->new();
$parser->codes_in_verbatim(0);
$parser->anchor_items(1); # the old Pod::Html always did
$parser->backlink($Backlink); # linkify =head1 directives
+ $parser->force_title($Title);
$parser->htmldir($Htmldir);
$parser->htmlfileurl($Htmlfileurl);
$parser->htmlroot($Htmlroot);
$parser->index($Doindex);
- $parser->no_errata_section(!$Poderrors); # note the inverse
$parser->output_string(\my $output); # written to file later
$parser->pages(\%Pages);
$parser->quiet($Quiet);
$parser->verbose($Verbose);
- # XXX: implement default title generator in pod::simple::xhtml
- # copy the way the old Pod::Html did it
- $Title = html_escape($Title);
-
# We need to add this ourselves because we use our own header, not
# ::XHTML's header. We need to set $parser->backlink to linkify
# the =head1 directives
@@ -405,20 +453,7 @@ $block
</html>
HTMLFOOT
- my $input;
- unless (@ARGV && $ARGV[0]) {
- if ($Podfile and $Podfile ne '-') {
- $input = $Podfile;
- } else {
- $input = '-'; # XXX: make a test case for this
- }
- } else {
- $Podfile = $ARGV[0];
- $input = *ARGV;
- }
-
- warn "Converting input file $Podfile\n" if $Verbose;
- $parser->parse_file($input);
+ feed_tree_to_parser($parser, $podtree);
# Write output to file
$Htmlfile = "-" unless $Htmlfile; # stdout
@@ -620,26 +655,18 @@ sub html_escape {
$rest =~ s/</&lt;/g;
$rest =~ s/>/&gt;/g;
$rest =~ s/"/&quot;/g;
- # &apos; is only in XHTML, not HTML4. Be conservative
- #$rest =~ s/'/&apos;/g;
+ $rest =~ s/([[:^print:]])/sprintf("&#x%x;", ord($1))/aeg;
return $rest;
}
#
# htmlify - converts a pod section specification to a suitable section
-# specification for HTML. Note that we keep spaces and special characters
-# except ", ? (Netscape problem) and the hyphen (writer's problem...).
+# specification for HTML. We adopt the mechanism used by the formatter
+# that we use.
#
sub htmlify {
my( $heading) = @_;
- $heading =~ s/(\s+)/ /g;
- $heading =~ s/\s+\Z//;
- $heading =~ s/\A\s+//;
- # The hyphen is a disgrace to the English language.
- # $heading =~ s/[-"?]//g;
- $heading =~ s/["?]//g;
- $heading = lc( $heading );
- return $heading;
+ return Pod::Simple::XHTML->can("idify")->(undef, $heading, 1);
}
#
@@ -767,7 +794,7 @@ sub resolve_pod_page_link {
# then $self->htmlroot eq '' (by definition of htmlfileurl) so
# $self->htmldir needs to be prepended to link to get the absolute path
# that will be relativized
- $url = relativize_url(
+ $url = Pod::Html::relativize_url(
File::Spec::Unix->catdir(Pod::Html::_unixify($self->htmldir), $url),
$self->htmlfileurl # already unixified
);
@@ -776,6 +803,8 @@ sub resolve_pod_page_link {
return $url . ".html$section";
}
+package Pod::Html;
+
#
# relativize_url - convert an absolute URL to one relative to a base URL.
# Assumes both end in a filename.
diff --git a/Master/tlpkg/tlperl/lib/Pod/Man.pm b/Master/tlpkg/tlperl/lib/Pod/Man.pm
index 886f614c7e6..a737e5b3e94 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Man.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Man.pm
@@ -14,7 +14,7 @@
# Written by Russ Allbery <rra@cpan.org>
# Substantial contributions by Sean Burke <sburke@cpan.org>
# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-# 2010, 2012, 2013, 2014, 2015, 2016 Russ Allbery <rra@cpan.org>
+# 2010, 2012, 2013, 2014, 2015, 2016, 2017 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
@@ -43,7 +43,7 @@ BEGIN {
@ISA = qw(Pod::Simple);
-$VERSION = '4.09';
+$VERSION = '4.10';
# Set the debugging level. If someone has inserted a debug function into this
# class already, use that. Otherwise, use any Pod::Simple debug function
@@ -535,8 +535,8 @@ sub guesswork {
# strings inserted around things that we've made small-caps if later
# transforms should work on those strings.
- # Italicize functions in the form func(), including functions that are in
- # all capitals, but don't italize if there's anything between the parens.
+ # Embolden functions in the form func(), including functions that are in
+ # all capitals, but don't embolden if there's anything between the parens.
# The function must start with an alphabetic character or underscore and
# then consist of word characters or colons.
if ($$self{MAGIC_FUNC}) {
@@ -544,11 +544,11 @@ sub guesswork {
( \b | \\s-1 )
( [A-Za-z_] ([:\w] | \\s-?[01])+ \(\) )
} {
- $1 . '\f(IS' . $2 . '\f(IE'
+ $1 . '\f(BS' . $2 . '\f(BE'
}egx;
}
- # Change references to manual pages to put the page name in italics but
+ # Change references to manual pages to put the page name in bold but
# the number in the regular font, with a thin space between the name and
# the number. Only recognize func(n) where func starts with an alphabetic
# character or underscore and contains only word characters, periods (for
@@ -562,7 +562,7 @@ sub guesswork {
( [A-Za-z_] (?:[.:\w] | \\- | \\s-?[01])+ )
( \( \d [a-z]* \) )
} {
- $1 . '\f(IS' . $2 . '\f(IE\|' . $3
+ $1 . '\f(BS' . $2 . '\f(BE\|' . $3
}egx;
}
@@ -800,13 +800,16 @@ sub start_document {
# has a PerlIO encoding layer set. If it does not, we'll need to encode
# our output before printing it (handled in the output() sub). Wrap the
# check in an eval to handle versions of Perl without PerlIO.
+ #
+ # PerlIO::get_layers still requires its argument be a glob, so coerce the
+ # file handle to a glob.
$$self{ENCODE} = 0;
if ($$self{utf8}) {
$$self{ENCODE} = 1;
eval {
my @options = (output => 1, details => 1);
- my $flag = (PerlIO::get_layers ($$self{output_fh}, @options))[-1];
- if ($flag & PerlIO::F_UTF8 ()) {
+ my @layers = PerlIO::get_layers (*{$$self{output_fh}}, @options);
+ if ($layers[-1] & PerlIO::F_UTF8 ()) {
$$self{ENCODE} = 0;
}
}
@@ -934,7 +937,7 @@ sub devise_title {
#
# If POD_MAN_DATE is set, that overrides anything else. This can be used for
# reproducible generation of the same file even if the input file timestamps
-# are unpredictable or the POD coms from standard input.
+# are unpredictable or the POD comes from standard input.
#
# Otherwise, if SOURCE_DATE_EPOCH is set and can be parsed as seconds since
# the UNIX epoch, base the timestamp on that. See
@@ -1392,7 +1395,7 @@ sub parse_from_file {
my $self = shift;
$self->reinit;
- # Fake the old cutting option to Pod::Parser. This fiddings with internal
+ # Fake the old cutting option to Pod::Parser. This fiddles with internal
# Pod::Simple state and is quite ugly; we need a better approach.
if (ref ($_[0]) eq 'HASH') {
my $opts = shift @_;
@@ -1553,16 +1556,20 @@ sub preamble_template {
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
-.if !\nF .nr F 0
-.if \nF>0 \{\
-. de IX
-. tm Index:\\$1\t\\n%\t"\\$2"
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{\
+. if \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
..
-. if !\nF==2 \{\
-. nr % 0
-. nr F 2
+. if !\nF==2 \{\
+. nr % 0
+. nr F 2
+. \}
. \}
.\}
+.rr rF
----END OF PREAMBLE----
#'# for cperl-mode
@@ -2016,7 +2023,7 @@ mine).
=head1 COPYRIGHT AND LICENSE
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-2009, 2010, 2012, 2013, 2014, 2015, 2016 Russ Allbery <rra@cpan.org>
+2009, 2010, 2012, 2013, 2014, 2015, 2016, 2017 Russ Allbery <rra@cpan.org>
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
@@ -2029,8 +2036,7 @@ L<man(1)>, L<man(7)>
Ossanna, Joseph F., and Brian W. Kernighan. "Troff User's Manual,"
Computing Science Technical Report No. 54, AT&T Bell Laboratories. This is
the best documentation of standard B<nroff> and B<troff>. At the time of
-this writing, it's available at
-L<http://www.cs.bell-labs.com/cm/cs/cstr.html>.
+this writing, it's available at L<http://www.troff.org/54.pdf>.
The man page documenting the man macro set may be L<man(5)> instead of
L<man(7)> on your system. Also, please see L<pod2man(1)> for extensive
diff --git a/Master/tlpkg/tlperl/lib/Pod/ParseLink.pm b/Master/tlpkg/tlperl/lib/Pod/ParseLink.pm
index 9a37a0532c2..9a1627079b4 100644
--- a/Master/tlpkg/tlperl/lib/Pod/ParseLink.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/ParseLink.pm
@@ -31,7 +31,7 @@ use Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(parselink);
-$VERSION = '4.09';
+$VERSION = '4.10';
##############################################################################
# Implementation
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc.pm
index 8d695b2b4b6..bb6ffc83efb 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc.pm
@@ -12,7 +12,7 @@ use File::Spec::Functions qw(catfile catdir splitdir);
use vars qw($VERSION @Pagers $Bindir $Pod2man
$Temp_Files_Created $Temp_File_Lifetime
);
-$VERSION = '3.28';
+$VERSION = '3.2801';
#..........................................................................
@@ -486,11 +486,6 @@ sub init_formatter_class_list {
$self->opt_M_with('Pod::Perldoc::ToPod'); # the always-there fallthru
$self->opt_o_with('text');
- $self->opt_o_with('term')
- unless $self->is_mswin32 || $self->is_dos || $self->is_amigaos
- || !($ENV{TERM} && (
- ($ENV{TERM} || '') !~ /dumb|emacs|none|unknown/i
- ));
return;
}
@@ -1937,11 +1932,6 @@ sub page { # apply a pager to the output file
} elsif($self->is_amigaos) {
last if system($pager, $output) == 0;
} else {
- my $formatter = $self->{'formatter_class'};
- if ( $formatter->can('pager_configuration') ) {
- $self->aside("About to call $formatter" . "->pager_configuration(\"$pager\")\n");
- $formatter->pager_configuration($pager, $self);
- }
last if system("$pager \"$output\"") == 0;
}
}
diff --git a/Master/tlpkg/tlperl/lib/Pod/Text.pm b/Master/tlpkg/tlperl/lib/Pod/Text.pm
index 211de5a7de8..f73b4af2b92 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Text.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Text.pm
@@ -39,7 +39,7 @@ use Pod::Simple ();
# We have to export pod2text for backward compatibility.
@EXPORT = qw(pod2text);
-$VERSION = '4.09';
+$VERSION = '4.10';
# Ensure that $Pod::Simple::nbsp and $Pod::Simple::shy are available. Code
# taken from Pod::Simple 3.32, but was only added in 3.30.
@@ -707,7 +707,7 @@ sub parse_from_file {
my $self = shift;
$self->reinit;
- # Fake the old cutting option to Pod::Parser. This fiddings with internal
+ # Fake the old cutting option to Pod::Parser. This fiddles with internal
# Pod::Simple state and is quite ugly; we need a better approach.
if (ref ($_[0]) eq 'HASH') {
my $opts = shift @_;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Text/Color.pm b/Master/tlpkg/tlperl/lib/Pod/Text/Color.pm
index a26e43db813..fa1aadb4633 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Text/Color.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Text/Color.pm
@@ -27,7 +27,7 @@ use vars qw(@ISA $VERSION);
@ISA = qw(Pod::Text);
-$VERSION = '4.09';
+$VERSION = '4.10';
##############################################################################
# Overrides
diff --git a/Master/tlpkg/tlperl/lib/Pod/Text/Overstrike.pm b/Master/tlpkg/tlperl/lib/Pod/Text/Overstrike.pm
index f611a4225b3..d0ce7680aa1 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Text/Overstrike.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Text/Overstrike.pm
@@ -35,13 +35,13 @@ use Pod::Text ();
@ISA = qw(Pod::Text);
-$VERSION = '4.09';
+$VERSION = '4.10';
##############################################################################
# Overrides
##############################################################################
-# Make level one headings bold, overridding any existing formatting.
+# Make level one headings bold, overriding any existing formatting.
sub cmd_head1 {
my ($self, $attrs, $text) = @_;
$text =~ s/\s+$//;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Text/Termcap.pm b/Master/tlpkg/tlperl/lib/Pod/Text/Termcap.pm
index 91939331f80..f015cfce597 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Text/Termcap.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Text/Termcap.pm
@@ -28,7 +28,7 @@ use vars qw(@ISA $VERSION);
@ISA = qw(Pod::Text);
-$VERSION = '4.09';
+$VERSION = '4.10';
##############################################################################
# Overrides