summaryrefslogtreecommitdiff
path: root/cpan/Pod-Simple/lib
diff options
context:
space:
mode:
authorJames E Keenan <jkeenan@cpan.org>2015-01-11 10:20:31 -0500
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2015-01-18 11:47:40 +0000
commitf23676cbac6a149c86b3fd0aa917c55ed6c542aa (patch)
tree5de565f64446838f717207963f1b0f4afbec0947 /cpan/Pod-Simple/lib
parentd676fe861a0916d8787409f8268b68369798ef21 (diff)
downloadperl-f23676cbac6a149c86b3fd0aa917c55ed6c542aa.tar.gz
Update Pod-Simple to CPAN version 3.29
[DELTA] 2015-01-13 David E. Wheeler <david@justatheory.org> * Release 3.29 NOTE: This will be the last release of Pod::Simple to support versions of Perl earlier than 5.6. Fixed test failure for unsupported encoding on Perl 5.6. Removed unnecessary dependency on constant. Reported by Petr Pisar (RT #85578). Many documentation and comment typos fixed by David Steinbrunner. Fixed issue when an encoding is declared via an '=encoding' directive *after* Pod::Simple has already detected an encoding. Thanks to Graham Knop for the patch and Patrice Dumas for the tests. Added '>&STDERR' as an output to better emulate Pod::Parser::parse_from_file(). Florent Angly. Tidied the description of the different Pod::Simple interfaces, with greater emphasis on the four different steps to subclassing. Florent Angly. Added the 'top_anchor' attribue to Pod::Simple::HTML, to allow specification of a custom top anchor format. Gabor Szabo. Fixed the text formatter to properly set the Text::Wrap overflow policy. Thanks to Nigel Metheringham for the fix! Fixed mis-matched quotation marks when adding JavaScript elements to the XHTML output. Patch from jonathancast. Fixed issues on EBCDIC. Patch from Karl Williamson (GitHub Pull Request #58). Fixed bug where the value passed to Pod::Simple::XHTML's html_css() method would be output twice. Thanks to Andrew Johnson for the report (RT #99303). Documented the 'recurse' attribute of Pod::Simple::Search. Thanks to Jim Keenan for the report (RT #91886). An error is no longer thrown when '=encoding' directives are found on subsequent lines. Instead, we now log a an error message, "Cannot have multiple =encoding directives" (RT #91757). The HTML and XHTML formatters now do a better job of preserving lines in 'begin html' blocks. Fixes a bug that dates from 2002 (Perl RT#9385, CPAN RT #91851). Collateral damage to 3 tests under ext/Pod-Html/.
Diffstat (limited to 'cpan/Pod-Simple/lib')
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple.pm19
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple.pod6
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm43
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Checker.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Debug.pm5
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm4
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/HTML.pm21
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm14
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm4
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Methody.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Progress.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm9
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/RTF.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Search.pm13
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm5
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod55
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Text.pm5
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm50
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm15
29 files changed, 170 insertions, 126 deletions
diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pm b/cpan/Pod-Simple/lib/Pod/Simple.pm
index fb5438f7f7..538969d9fb 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple.pm
@@ -18,7 +18,7 @@ use vars qw(
);
@ISA = ('Pod::Simple::BlackBox');
-$VERSION = '3.28';
+$VERSION = '3.29';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
@@ -105,7 +105,7 @@ __PACKAGE__->_accessorize(
# $pod_handler->($line, $self->{'line_count'}, $self) if $pod_handler;
# $wl_handler->($line, $self->{'line_count'}, $self) if $wl_handler;
'parse_empty_lists', # whether to acknowledge empty =over/=back blocks
-
+ 'raw_mode', # to report entire raw lines instead of Pod elements
);
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ -487,7 +487,7 @@ sub parse_from_file {
} elsif(ref(\$source) eq 'GLOB') { # stet
} elsif(ref($source) ) { # stet
} elsif(!length $source
- or $source eq '-' or $source =~ m/^<&(STDIN|0)$/i
+ or $source eq '-' or $source =~ m/^<&(?:STDIN|0)$/i
) {
$source = *STDIN{IO};
}
@@ -499,6 +499,8 @@ sub parse_from_file {
or $to eq '-' or $to =~ m/^>&?(?:STDOUT|1)$/i
) {
$self->output_fh( *STDOUT{IO} );
+ } elsif($to =~ m/^>&(?:STDERR|2)$/i) {
+ $self->output_fh( *STDERR{IO} );
} else {
require Symbol;
my $out_fh = Symbol::gensym();
@@ -1439,6 +1441,14 @@ sub _treat_Ss {
return;
}
+# We can get NO BREAK SPACE accurately for any platform for recent Perls; for
+# earlier ones use the ASCII value for those platforms, and assume the typical
+# EBCDIC value for any others.
+my $nbsp = ($] >= 5.007003)
+ ? chr utf8::unicode_to_native(0xA0)
+ : (ASCII)
+ ? "\xA0"
+ : "\x41";
sub _change_S_to_nbsp { # a recursive function
# Sanely assumes that the top node in the excursion won't be an S node.
@@ -1457,8 +1467,7 @@ sub _change_S_to_nbsp { # a recursive function
$i += @$to_pull_up - 1; # Make $i skip the pulled-up stuff
}
} else {
- $treelet->[$i] =~ s/\s/\xA0/g if ASCII and $in_s;
- # (If not in ASCIIland, we can't assume that \xA0 == nbsp.)
+ $treelet->[$i] =~ s/\s/$nbsp/g if $in_s;
# Note that if you apply nbsp_for_S to text, and so turn
# "foo S<bar baz> quux" into "foo bar&#160;faz quux", you
diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pod b/cpan/Pod-Simple/lib/Pod/Simple.pod
index 4edc08ed67..aadba19e94 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple.pod
+++ b/cpan/Pod-Simple/lib/Pod/Simple.pod
@@ -42,8 +42,8 @@ of Pod::Simple.
=item C<< $parser->output_fh( *OUT ); >>
This sets the filehandle that C<$parser>'s output will be written to.
-You can pass C<*STDOUT>, otherwise you should probably do something
-like this:
+You can pass C<*STDOUT> or C<*STDERR>, otherwise you should probably do
+something like this:
my $outfile = "output.txt";
open TXTOUT, ">$outfile" or die "Can't write to $outfile: $!";
@@ -183,7 +183,7 @@ verbatim blocks will be preserved in the output. This can be annoying for
outputs such as HTML, where that whitespace will remain in front of every
line. It's an unfortunate case where syntax is turned into semantics.
-If the POD your parsing adheres to a consistent indentation policy, you can
+If the POD you're parsing adheres to a consistent indentation policy, you can
have such indentation stripped from the beginning of every line of your
verbatim blocks. This method tells Pod::Simple what to strip. For two-space
indents, you'd use:
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
index a1b570810d..ee6e747a6a 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm b/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm
index 92e1bee238..3ef64eea65 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm b/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm
index b170bb780a..2bbd50a664 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm
index 019dfd57fb..dfde4d66b2 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
index ac925c08ef..4db6a06149 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm
index 8a2f81569c..2c6494b9ba 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm
index e41b11e2c5..19e700b825 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm b/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm
index be1f5345d0..2139509303 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm b/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm
index 38acaa20d0..d867b1ce93 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm b/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm
index f9cd681672..3a87b99842 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm
index 5c13724dc1..0e47ec3413 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm
index 5fa402318e..bb5ac7adbf 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm
index 3edb0ad569..dbb0b2c859 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm
index a75fd7a706..9db7f1ee8f 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm
index bbae51ba69..46ab1fd4d3 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm b/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm
index 067e6b9dd3..617190418b 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/Search.pm b/cpan/Pod-Simple/lib/Pod/Simple/Search.pm
index 15cb292fc5..49df34d354 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Search.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm b/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm
index 0b42a22b27..201e37aac9 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod b/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod
index 7a7976bdc4..e3f09a34e1 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/Text.pm b/cpan/Pod-Simple/lib/Pod/Simple/Text.pm
index bd1a5416df..b3292f8c49 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Text.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm b/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm
index 6788df6d76..516f28cb22 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm b/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm
index 0b2fb2f8c4..dbf5210388 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm b/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm
index 9e835048a0..9c60f05d02 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm
index 4749e9af19..badb9a0d43 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm
index 06fdb9f275..6735b9979b 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm
index df896e64a7..3a2d2094c6 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm
+++ b/cpan/Pod-Simple/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/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm b/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm
index 47496e2577..a0f50a20fb 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm
+++ b/cpan/Pod-Simple/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>