summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Pod/Simple
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-05 22:27:26 +0000
committerKarl Berry <karl@freefriends.org>2016-04-05 22:27:26 +0000
commitb56b320b5e2515160073fa1b469514002688fe11 (patch)
tree965a7100c5e45fca8ec803d22b8b6ce14fca4633 /Master/tlpkg/tlperl/lib/Pod/Simple
parentd26c206452d2e285c3bbf949f34011e4a55fd8f9 (diff)
tlperl 5.22.1 from siep
git-svn-id: svn://tug.org/texlive/trunk@40252 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod/Simple')
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm43
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm21
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm14
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Methody.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm9
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParserStartToken.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParserTextToken.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParserToken.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/RTF.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm13
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod55
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/XHTML.pm50
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm15
27 files changed, 153 insertions, 118 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm
index a1b570810d0..ee6e747a6a0 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm
@@ -1,4 +1,3 @@
-
package Pod::Simple::BlackBox;
#
# "What's in the box?" "Pain."
@@ -23,7 +22,7 @@ use integer; # vroom!
use strict;
use Carp ();
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
#use constant DEBUG => 7;
BEGIN {
require Pod::Simple;
@@ -127,13 +126,25 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines)
# Try to guess encoding. Inlined for performance reasons.
if(!$self->{'parse_characters'} && !$self->{'encoding'}
&& ($self->{'in_pod'} || $line =~ /^=/s)
- && $line =~ /[^\x00-\x7f]/
+ && $line =~ /[[:^ascii:]]/
) {
- my $encoding = $line =~ /^[\x00-\x7f]*[\xC0-\xFD][\x80-\xBF]/ ? 'UTF-8' : 'ISO8859-1';
+ my $encoding;
+ if (ord("A") != 65) {
+
+ # Hard to figure out on non-ASCII platform if UTF-8 or not. This
+ # won't work if it isn't UTF-8, so just assume it is and hope for the
+ # best. It's not clear that the other encodings work on non-ASCII
+ # platforms anyway.
+ $encoding = 'UTF-8';
+ }
+ else {
+ $encoding = $line =~ /^[\x00-\x7f]*[\xC0-\xFD][\x80-\xBF]/ ? 'UTF-8' : 'ISO8859-1';
+ }
$self->_handle_encoding_line( "=encoding $encoding" );
+ delete $self->{'_processed_encoding'};
$self->{'_transcoder'} && $self->{'_transcoder'}->($line);
- my ($word) = $line =~ /(\S*[^\x00-\x7f]\S*)/;
+ my ($word) = $line =~ /(\S*[[:^ascii:]]\S*)/;
$self->whine(
$self->{'line_count'},
@@ -376,8 +387,8 @@ sub _handle_encoding_line {
}
push @{ $self->{'encoding_command_statuses'} }, $enc_error;
if (defined($self->{'_processed_encoding'})) {
- # Should never happen
- die "Nested processed encoding.";
+ # Double declaration.
+ $self->scream( $self->{'line_count'}, 'Cannot have multiple =encoding directives');
}
$self->{'_processed_encoding'} = $orig;
@@ -1980,20 +1991,20 @@ sub pretty { # adopted from Class::Classless
$_ eq '0' # very common case
or(
m/^-?(?:[123456789]\d*|0)(?:\.\d+)?$/s
- and $_ ne '-0' # the strange case that that RE lets thru
+ and $_ ne '-0' # the strange case that RE lets thru
)
) { $_;
} else {
- if( chr(65) eq 'A' ) {
- s<([^\x20\x21\x23\x27-\x3F\x41-\x5B\x5D-\x7E])>
- #<$pretty_form{$1} || '\\x'.(unpack("H2",$1))>eg;
+ # Yes, explicitly name every character desired. There are shorcuts one
+ # could make, but I (Karl Williamson) was afraid that some Perl
+ # releases would have bugs in some of them. For example [A-Z] works
+ # even on EBCDIC platforms to match exactly the 26 uppercase English
+ # letters, but I don't know if it has always worked without bugs. It
+ # seemed safest just to list the characters.
+ # s<([^\x20\x21\x23\x27-\x3F\x41-\x5B\x5D-\x7E])>
+ s<([^ !#'()*+,\-./0123456789:;\<=\>?ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\]^_`abcdefghijklmnopqrstuvwxyz{|}~])>
<$pretty_form{$1} || '\\x{'.sprintf("%x", ord($1)).'}'>eg;
- } else {
- # We're in some crazy non-ASCII world!
- s<([^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])>
#<$pretty_form{$1} || '\\x'.(unpack("H2",$1))>eg;
- <$pretty_form{$1} || '\\x{'.sprintf("%x", ord($1)).'}'>eg;
- }
qq{"$_"};
}
} @stuff;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm
index 92e1bee238a..3ef64eea650 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.28';
+$VERSION = '3.29';
@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 b170bb780ab..2bbd50a6643 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm
@@ -1,9 +1,8 @@
-
require 5;
package Pod::Simple::Debug;
use strict;
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
sub import {
my($value,$variable);
@@ -97,7 +96,7 @@ Note that you should load this module I<before> loading Pod::Simple (or
any Pod::Simple-based class). If you try loading Pod::Simple::Debug
after &Pod::Simple::DEBUG is already defined, Pod::Simple::Debug will
throw a fatal error to the effect that
-"it's s too late to call Pod::Simple::Debug".
+"It's too late to call Pod::Simple::Debug".
Note that the C<use Pod::Simple::Debug (\$x, I<somenum>)> mode will make
Pod::Simple (et al) run rather slower, since &Pod::Simple::DEBUG won't
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm
index 019dfd57fbd..dfde4d66b2c 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.28';
+$VERSION = '3.29';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
@@ -54,7 +54,7 @@ sub _handle_text {
[^\n]{55} # Snare some characters from a line
[^\n\ ]{0,50} # and finish any current word
)
- \x20{1,10}(?!\n) # capture some spaces not at line-end
+ \ {1,10}(?!\n) # capture some spaces not at line-end
/$1"\n$indent . "/gx # => line-break here
;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
index ac925c08eff..4db6a061494 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.28';
+$VERSION = '3.29';
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 8a2f81569c1..2c6494b9ba2 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm
@@ -1,4 +1,3 @@
-
require 5;
package Pod::Simple::HTML;
use strict;
@@ -10,8 +9,7 @@ use vars qw(
$Doctype_decl $Content_decl
);
@ISA = ('Pod::Simple::PullParser');
-$VERSION = '3.28';
-
+$VERSION = '3.29';
BEGIN {
if(defined &DEBUG) { } # no-op
elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG }
@@ -75,6 +73,7 @@ __PACKAGE__->_accessorize(
'html_header_before_title',
'html_header_after_title',
'html_footer',
+ 'top_anchor',
'index', # whether to add an index at the top of each page
# (actually it's a table-of-contents, but we'll call it an index,
@@ -209,6 +208,7 @@ sub new {
"<!-- start doc -->\n",
);
$new->html_footer( qq[\n<!-- end doc -->\n\n</body></html>\n] );
+ $new->top_anchor( "<a name='___top' class='dummyTopAnchor' ></a>\n" );
$new->{'Tagmap'} = {%Tagmap};
@@ -312,7 +312,7 @@ sub do_beginning {
sub _add_top_anchor {
my($self, $text_r) = @_;
unless($$text_r and $$text_r =~ m/name=['"]___top['"]/) { # a hack
- $$text_r .= "<a name='___top' class='dummyTopAnchor' ></a>\n";
+ $$text_r .= $self->top_anchor || '';
}
return;
}
@@ -524,7 +524,9 @@ sub _do_middle_main_loop {
next;
}
DEBUG and print " raw text ", $next->text, "\n";
- print $fh "\n" . $next->text . "\n";
+ # The parser sometimes preserves newlines and sometimes doesn't!
+ (my $text = $next->text) =~ s/\n\z//;
+ print $fh $text, "\n";
next;
} else {
@@ -969,7 +971,7 @@ Set the content-type in the HTML head: (defaults to ISO-8859-1)
$Pod::Simple::HTML::Content_decl = q{<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >};
-Set the value that will be ebedded in the opening tags of F, C tags and verbatim text.
+Set the value that will be embedded in the opening tags of F, C tags and verbatim text.
F maps to <em>, C maps to <code>, Verbatim text maps to <pre> (Computerese defaults to "")
$Pod::Simple::HTML::Computerese = ' class="some_class_name';
@@ -990,6 +992,13 @@ file:
$p->html_header_before_title('<html><head><title>');
+=head2 top_anchor
+
+By default Pod::Simple::HTML adds a dummy anchor at the top of the HTML.
+You can change it by calling
+
+ $p->top_anchor('<a name="zz" >');
+
=head2 html_h_level
Normally =head1 will become <h1>, =head2 will become <h2> etc.
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm
index e41b11e2c50..19e700b825f 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.28';
+$VERSION = '3.29';
@ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML!
# TODO: nocontents stylesheets. Strike some of the color variations?
@@ -1310,18 +1310,6 @@ TODO
that classname
-
-=head1 ASK ME!
-
-If you want to do some kind of big pod-to-HTML version with some
-particular kind of option that you don't see how to achieve using this
-module, email me (C<sburke@cpan.org>) and I'll probably have a good idea
-how to do it. For reasons of concision and energetic laziness, some
-methods and options in this module (and the dozen modules it depends on)
-are undocumented; but one of those undocumented bits might be just what
-you're looking for.
-
-
=head1 SEE ALSO
L<Pod::Simple>, L<Pod::Simple::HTMLBatch>, L<perlpod>, L<perlpodspec>
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm
index be1f5345d08..2139509303e 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm
@@ -3,12 +3,12 @@ require 5;
package Pod::Simple::LinkSection;
# Based somewhat dimly on Array::Autojoin
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
use strict;
use Pod::Simple::BlackBox;
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
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 38acaa20d0b..d867b1ce932 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.28';
+$VERSION = '3.29';
@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 f9cd6816722..3a87b998423 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.28';
+$VERSION = '3.29';
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 5c13724dc11..0e47ec3413b 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm
@@ -1,7 +1,6 @@
-
require 5;
package Pod::Simple::PullParser;
-$VERSION = '3.28';
+$VERSION = '3.29';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
@@ -688,7 +687,7 @@ If the title can't be found, then get_short_title returns empty-string
This works like get_title except that it returns the contents of the
"=head1 AUTHOR\n\nParagraph...\n" section, assuming that that section
isn't terribly long. To recognize a "=head1 Author\n\nParagraph\n"
-section, pass the C<nocase> otpion:
+section, pass the C<nocase> option:
$parser->get_author(nocase => 1);
@@ -699,7 +698,7 @@ section, pass the C<nocase> otpion:
This works like get_title except that it returns the contents of the
"=head1 DESCRIPTION\n\nParagraph...\n" section, assuming that that section
isn't terribly long. To recognize a "=head1 Description\n\nParagraph\n"
-section, pass the C<nocase> otpion:
+section, pass the C<nocase> option:
$parser->get_description(nocase => 1);
@@ -708,7 +707,7 @@ section, pass the C<nocase> otpion:
This works like get_title except that it returns the contents of
the "=head1 VERSION\n\n[BIG BLOCK]\n" block. Note that this does NOT
return the module's C<$VERSION>!! To recognize a
-"=head1 Version\n\n[BIG BLOCK]\n" section, pass the C<nocase> otpion:
+"=head1 Version\n\n[BIG BLOCK]\n" section, pass the C<nocase> option:
$parser->get_version(nocase => 1);
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm
index 5fa402318eb..bb5ac7adbfe 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.28';
+$VERSION = '3.29';
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 3edb0ad5695..dbb0b2c859f 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.28';
+$VERSION = '3.29';
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 a75fd7a706e..9db7f1ee8fc 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.28';
+$VERSION = '3.29';
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 bbae51ba69e..46ab1fd4d3a 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.28';
+$VERSION = '3.29';
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 067e6b9dd35..617190418b6 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.28';
+$VERSION = '3.29';
use Pod::Simple::PullParser ();
BEGIN {@ISA = ('Pod::Simple::PullParser')}
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
index 15cb292fc50..49df34d3543 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
@@ -1,10 +1,9 @@
-
require 5.005;
package Pod::Simple::Search;
use strict;
use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY);
-$VERSION = '3.28'; ## Current version of this package
+$VERSION = '3.29'; ## Current version of this package
BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level
use Carp ();
@@ -768,7 +767,6 @@ are produced. (Setting verbose to 1 turns on some messages, and setting
it to 2 turns on even more messages, i.e., makes the following search(es)
even more verbose than 1 would make them.)
-
=item $search->limit_glob( I<some-glob-string> );
This option means that you want to limit the results just to items whose
@@ -806,6 +804,10 @@ seeing only files with Perl-like extensions, omitting subdirectories
that are numeric but do I<not> match the current Perl interpreter's
version ID, suppressing F<site_perl> as a module hierarchy name, etc.
+=item $search->recurse( I<true-or-false> );
+
+Unless you set this attribute to a false value, Pod::Search will
+recurse into subdirectories of the search directories.
=item $search->shadows( I<true-or-false> );
@@ -834,7 +836,7 @@ C<limit_glob> attribute is used instead.
Setting this attribute to a string value means that the searches should
begin in the specified subdirectory name (like "Pod" or "File::Find",
-also expressable as "File/Find"). For example, the search option
+also expressible as "File/Find"). For example, the search option
C<< $search->limit_glob("File::Find::R*") >>
is the same as the combination of the search options
C<< $search->limit_re("^File::Find::R") -> dir_prefix("File::Find") >>.
@@ -942,8 +944,7 @@ version than the system's general path dirs in general.)
The options to this argument is a list of either directories that are
searched recursively, or files. (Usually you wouldn't specify files,
but just dirs.) Or you can just specify an empty-list, as in
-$name2path; with the
-C<inc> option on, as it is by default, teh
+$name2path; with the C<inc> option on, as it is by default.
The POD names of files are the plain basenames with any Perl-like
extension (.pm, .pl, .pod) stripped, and path separators replaced by
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm
index 0b42a22b273..201e37aac95 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm
@@ -1,12 +1,11 @@
-
require 5;
package Pod::Simple::SimpleTree;
use strict;
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '3.28';
+$VERSION = '3.29';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
@@ -121,7 +120,7 @@ the form: C<[ I<elementname>, \%attributes, I<...subnodes...> ]>.
See the example tree dump in the Synopsis, above.
Every text node in the tree is represented by a simple (non-ref)
-string scalar. So you can test C<ref($node)> to see whather you have
+string scalar. So you can test C<ref($node)> to see whether you have
an element node or just a text node.
The top node in the tree is C<[ 'Document', \%attributes,
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod b/Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod
index 7a7976bdc47..e3f09a34e1b 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod
@@ -1,4 +1,3 @@
-
=head1 NAME
Pod::Simple::Subclassing -- write a formatter as a Pod::Simple subclass
@@ -38,7 +37,7 @@ generally a Pod formatter. If you just want to know about using an
existing Pod formatter, instead see its documentation and see also the
docs in L<Pod::Simple>.
-The zeroeth step in writing a Pod formatter is to make sure that there
+B<The zeroeth step> in writing a Pod formatter is to make sure that there
isn't already a decent one in CPAN. See L<http://search.cpan.org/>, and
run a search on the name of the format you want to render to. Also
consider joining the Pod People list
@@ -46,29 +45,47 @@ L<http://lists.perl.org/showlist.cgi?name=pod-people> and asking whether
anyone has a formatter for that format -- maybe someone cobbled one
together but just hasn't released it.
-The first step in writing a Pod processor is to read L<perlpodspec>,
+B<The first step> in writing a Pod processor is to read L<perlpodspec>,
which contains notes information on writing a Pod parser (which has been
largely taken care of by Pod::Simple), but also a lot of requirements
and recommendations for writing a formatter.
-The second step is to actually learn the format you're planning to
+B<The second step> is to actually learn the format you're planning to
format to -- or at least as much as you need to know to represent Pod,
which probably isn't much.
-The third step is to pick which of Pod::Simple's interfaces you want to
-use -- the basic interface via Pod::Simple or L<Pod::Simple::Methody> is
-event-based, sort of like L<HTML::Parser>'s interface, or sort of like
-L<XML::Parser>'s "Handlers" interface), but L<Pod::Simple::PullParser>
-provides a token-stream interface, sort of like L<HTML::TokeParser>'s
-interface; L<Pod::Simple::SimpleTree> provides a simple tree interface,
-rather like XML::Parser's "Tree" interface. Users familiar with
-XML-handling will find one of these styles relatively familiar; but if
-you would be even more at home with XML, there are classes that produce
-an XML representation of the Pod stream, notably
-L<Pod::Simple::XMLOutStream>; you can feed the output of such a class to
-whatever XML parsing system you are most at home with.
-
-The last step is to write your code based on how the events (or tokens,
+B<The third step> is to pick which of Pod::Simple's interfaces you want to
+use:
+
+=over
+
+=item Pod::Simple
+
+The basic L<Pod::Simple> interface that uses C<_handle_element_start()>,
+C<_handle_element_end()> and C<_handle_text()>.
+
+=item Pod::Simple::Methody
+
+The L<Pod::Simple::Methody> interface is event-based, similar to that of
+L<HTML::Parser> or L<XML::Parser>'s "Handlers".
+
+=item Pod::Simple::PullParser
+
+L<Pod::Simple::PullParser> provides a token-stream interface, sort of
+like L<HTML::TokeParser>'s interface.
+
+=item Pod::Simple::SimpleTree
+
+L<Pod::Simple::SimpleTree> provides a simple tree interface, rather like
+L<XML::Parser>'s "Tree" interface. Users familiar with XML handling will
+be comfortable with this interface. Users interested in outputting XML,
+should look into the modules that produce an XML representation of the
+Pod stream, notably L<Pod::Simple::XMLOutStream>; you can feed the output
+of such a class to whatever XML parsing system you are most at home with.
+
+=back
+
+B<The last step> is to write your code based on how the events (or tokens,
or tree-nodes, or the XML, or however you're parsing) will map to
constructs in the output format. Also sure to consider how to escape
text nodes containing arbitrary text, and also what to do with text
@@ -545,7 +562,7 @@ an "<UL><LI>...</LI>...</UL>" structure), but which any processor may use.
Note that the values for the I<number> attributes of "item-number"
elements in a given "over-number" area I<will> start at 1 and go up by
one each time. If the Pod source doesn't follow that order (even though
-it really should should!), whatever numbers it has will be ignored (with
+it really should!), whatever numbers it has will be ignored (with
the correct values being put in the I<number> attributes), and an error
message might be issued to the user.
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm
index bd1a5416df8..b3292f8c498 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.28';
+$VERSION = '3.29';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
@@ -14,7 +14,8 @@ BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
}
use Text::Wrap 98.112902 ();
-$Text::Wrap::wrap = 'overflow';
+$Text::Wrap::huge = 'overflow';
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub new {
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm
index 6788df6d762..516f28cb223 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.28';
+$VERSION = '3.29';
@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 0b2fb2f8c49..dbf5210388e 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.28';
+$VERSION = '3.29';
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm
index 9e835048a0e..9c60f05d021 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm
@@ -2,7 +2,7 @@
require 5;
package Pod::Simple::Transcode;
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
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 4749e9af198..badb9a0d439 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.28';
+$VERSION = '3.29';
# 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 06fdb9f2750..6735b9979b3 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.28';
+$VERSION = '3.29';
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 df896e64a7c..3a2d2094c68 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.28';
+$VERSION = '3.29';
use Pod::Simple::Methody ();
@ISA = ('Pod::Simple::Methody');
@@ -132,7 +132,7 @@ A document type tag for the file. This option is not set by default.
=head2 html_charset
-The charater set to declare in the Content-Type meta tag created by default
+The character set to declare in the Content-Type meta tag created by default
for C<html_header_tags>. Note that this option will be ignored if the value of
C<html_header_tags> is changed. Defaults to "ISO-8859-1".
@@ -313,9 +313,9 @@ The base implementation just escapes the text.
The callback methods C<start_code> and C<end_code> emits the C<code> tags
before and after C<handle_code> is invoked, so you might want to override these
-together with C<handle_code> if this wrapping isn't suiteable.
+together with C<handle_code> if this wrapping isn't suitable.
-Note that the code might be broken into mulitple segments if there are
+Note that the code might be broken into multiple segments if there are
nested formatting codes inside a C<< CE<lt>...> >> sequence. In between the
calls to C<handle_code> other markup tags might have been emitted in that
case. The same is true for verbatim sections if the C<codes_in_verbatim>
@@ -352,7 +352,23 @@ sub handle_text {
# literal xhtml region, since handle_code calls encode_entities.
$_[0]->handle_code( $_[1], $_[0]{'in_code'}[-1] );
} else {
- $_[0]{'scratch'} .= $text;
+ if ($_[0]->{in_for}) {
+ my $newlines = $_[0]->__in_literal_xhtml_region ? "\n\n" : '';
+ if ($_[0]->{started_for}) {
+ if ($text =~ /\S/) {
+ delete $_[0]->{started_for};
+ $_[0]{'scratch'} .= $text . $newlines;
+ }
+ # Otherwise, append nothing until we have something to append.
+ } else {
+ # The parser sometimes preserves newlines and sometimes doesn't!
+ $text =~ s/\n\z//;
+ $_[0]{'scratch'} .= $text . $newlines;
+ }
+ } else {
+ # Just plain text.
+ $_[0]{'scratch'} .= $text;
+ }
}
$_[0]{htext} .= $text if $_[0]{'in_head'};
@@ -371,7 +387,7 @@ sub handle_code {
}
sub start_Para {
- $_[0]{'scratch'} = '<p>';
+ $_[0]{'scratch'} .= '<p>';
}
sub start_Verbatim {
@@ -496,20 +512,27 @@ sub start_for {
my ($self, $flags) = @_;
push @{ $self->{__region_targets} }, $flags->{target_matching};
+ $self->{started_for} = 1;
+ $self->{in_for} = 1;
unless ($self->__in_literal_xhtml_region) {
$self->{scratch} .= '<div';
$self->{scratch} .= qq( class="$flags->{target}") if $flags->{target};
- $self->{scratch} .= '>';
+ $self->{scratch} .= ">\n\n";
}
-
- $self->emit;
-
}
+
sub end_for {
my ($self) = @_;
+ delete $self->{started_for};
+ delete $self->{in_for};
- $self->{'scratch'} .= '</div>' unless $self->__in_literal_xhtml_region;
+ if ($self->__in_literal_xhtml_region) {
+ # Remove trailine newlines.
+ $self->{'scratch'} =~ s/\s+\z//s;
+ } else {
+ $self->{'scratch'} .= '</div>';
+ }
pop @{ $self->{__region_targets} };
$self->emit;
@@ -526,16 +549,17 @@ sub start_Document {
$title = $self->force_title || $self->title || $self->default_title || '';
$metatags = $self->html_header_tags || '';
if (my $css = $self->html_css) {
- $metatags .= $css;
if ($css !~ /<link/) {
# this is required to be compatible with Pod::Simple::BatchHTML
$metatags .= '<link rel="stylesheet" href="'
. $self->encode_entities($css) . '" type="text/css" />';
+ } else {
+ $metatags .= $css;
}
}
if ($self->html_javascript) {
$metatags .= qq{\n<script type="text/javascript" src="} .
- $self->html_javascript . "'></script>";
+ $self->html_javascript . '"></script>';
}
$bodyid = $self->backlink ? ' id="_podtop_"' : '';
$self->{'scratch'} .= <<"HTML";
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm
index 47496e2577f..a0f50a20fb2 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.28';
+$VERSION = '3.29';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
@@ -125,19 +125,6 @@ The older (and possibly obsolete) libraries L<Pod::PXML>, L<Pod::XML>
TODO: An example or two of =extend, then point to Pod::Simple::Subclassing
-
-=head1 ASK ME!
-
-If you actually want to use Pod as a format that you want to render to
-XML (particularly if to an XML instance with more elements than normal
-Pod has), please email me (C<sburke@cpan.org>) and I'll probably have
-some recommendations.
-
-For reasons of concision and energetic laziness, some methods and
-options in this module (and the dozen modules it depends on) are
-undocumented; but one of those undocumented bits might be just what
-you're looking for.
-
=head1 SEE ALSO
L<Pod::Simple>, L<Pod::Simple::Text>, L<Pod::Spell>