'Pod::Simple' =>
{
'MAINTAINER' => 'arandal',
- 'DISTRIBUTION' => 'DWHEELER/Pod-Simple-3.16.tar.gz',
+ 'DISTRIBUTION' => 'DWHEELER/Pod-Simple-3.17.tar.gz',
'FILES' => q[cpan/Pod-Simple],
- # XXX these two files correspond to similar ones in blead under
- # pod/, but the blead ones have newer changes, and also seem to
- # have been in blead a long time. I'm going to assume then that
- # the blead versions of these two files are authoritative - DAPM
- # Now been removed from Pod-Simple-3.15 commenting this out - bingos
- #'EXCLUDED' => [ qw( lib/perlpod.pod lib/perlpodspec.pod ) ],
'UPSTREAM' => 'cpan',
},
# ChangeLog for Pod::Simple dist
#---------------------------------------------------------------------------
+2011-07-09 David E. Wheeler <david@justatheory.org>
+ * Release 3.17
+
+ Documented tertiary methods. Patch from Shawn H Corey.
+
+ Added "backlink" option to Pod::Simple::XHTML. Thanks to Marc
+ Green/Google Summer of Code for the pull request.
+
+ Typos fixed in Pod::Simple::HTMLBatch. Reported by Shawn H Corey.
+
+ Fixed quoting of value returned by a "strip_verbatim_indent()"
+ code reference so that regex meta characters are properly escaped.
+
+ Added "anchor_items" option to Pod::Simple::XHMTL. This allows
+ text items (which are output as <dt> elements) to have IDs that
+ can be referenced in the "#" part of a URL. Marc Green/Google
+ Summer of Code.
+
+ Added "recurse" option to Pod::Simple::Search. It's enabled by
+ default; disable it to turn off recursion into subdirectories.
+ Marc Green/Google Summer of Code.
+
+ Added documentation to clarify the behavior of the "content_seen"
+ method. Thanks to Olaf Alders for the pull request.
+
2011-03-14 David E. Wheeler <david@justatheory.org>
* Release 3.16
spelled "=encode"). Thanks to "TTY" for the patch. (RT #24820).
2010-11-11 David E. Wheeler <david@justatheory.org>
- * Release 3.16
+ * Release 3.17
Removed "perlpod.pod" and "perlpodspec.pod". These now just live
in the Perl core.
-=head1 Pod::Simple version 3.16
+=head1 Pod::Simple version 3.17
Pod::Simple is a Perl library for parsing text in the Pod ("plain old
documentation") markup language that is typically used for writing
);
@ISA = ('Pod::Simple::BlackBox');
-$VERSION = '3.16';
+$VERSION = '3.17';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
=item C<< $parser->content_seen >>
-This returns true only if there has been any real content seen
-for this document.
-
+This returns true only if there has been any real content seen for this
+document. Returns false in cases where the document contains content,
+but does not make use of any Pod markup.
=item C<< I<SomeClass>->filter( I<$filename> ); >>
=back
+=head1 TERTIARY METHODS
+
+=over
+
+=item C<< $parser->abandon_output_fh() >>X<abandon_output_fh>
+
+Cancel output to the file handle. Any POD read by the C<$parser> is not
+effected.
+
+=item C<< $parser->abandon_output_string() >>X<abandon_output_string>
+
+Cancel output to the output string. Any POD read by the C<$parser> is not
+effected.
+
+=item C<< $parser->accept_code( @codes ) >>X<accept_code>
+
+Alias for L<< accept_codes >>.
+
+=item C<< $parser->accept_codes( @codes ) >>X<accept_codes>
+
+Allows C<$parser> to accept a list of L<perlpod/Formatting Codes>. This can be
+used to implement user-defined codes.
+
+=item C<< $parser->accept_directive_as_data( @directives ) >>X<accept_directive_as_data>
+
+Allows C<$parser> to accept a list of directives for data paragraphs. A
+directive is the label of a L<perlpod/Command Paragraph>. A data paragraph is
+one delimited by C<< =begin/=for/=end >> directives. This can be used to
+implement user-defined directives.
+
+=item C<< $parser->accept_directive_as_processed( @directives ) >>X<accept_directive_as_processed>
+
+Allows C<$parser> to accept a list of directives for processed paragraphs. A
+directive is the label of a L<perlpod/Command Paragraph>. A processed
+paragraph is also known as L<perlpod/Ordinary Paragraph>. This can be used to
+implement user-defined directives.
+
+=item C<< $parser->accept_directive_as_verbatim( @directives ) >>X<accept_directive_as_verbatim>
+
+Allows C<$parser> to accept a list of directives for L<perlpod/Verbatim
+Paragraph>. A directive is the label of a L<perlpod/Command Paragraph>. This
+can be used to implement user-defined directives.
+
+=item C<< $parser->accept_target( @targets ) >>X<accept_target>
+
+Alias for L<< accept_targets >>.
+
+=item C<< $parser->accept_target_as_text( @targets ) >>X<accept_target_as_text>
+
+Alias for L<< accept_targets_as_text >>.
+
+=item C<< $parser->accept_targets( @targets ) >>X<accept_targets>
+
+Accepts targets for C<< =begin/=for/=end >> sections of the POD.
+
+=item C<< $parser->accept_targets_as_text( @targets ) >>X<accept_targets_as_text>
+
+Accepts targets for C<< =begin/=for/=end >> sections that should be parsed as
+POD. For details, see L<< perlpodspec/About Data Paragraphs >>.
+
+=item C<< $parser->any_errata_seen() >>X<any_errata_seen>
+
+Used to check if any errata was seen.
+
+I<Example:>
+
+ die "too many errors\n" if $parser->any_errata_seen();
+
+=item C<< $parser->parse_from_file( $source, $to ) >>X<parse_from_file>
+
+Parses from C<$source> file to C<$to> file. Similar to L<<
+Pod::Parser/parse_from_file >>.
+
+=item C<< $parser->scream( @error_messages ) >>X<scream>
+
+Log an error that can't be ignored.
+
+=item C<< $parser->unaccept_code( @codes ) >>X<unaccept_code>
+
+Alias for L<< unaccept_codes >>.
+
+=item C<< $parser->unaccept_codes( @codes ) >>X<unaccept_codes>
+
+Removes C<< @codes >> as valid codes for the parse.
+
+=item C<< $parser->unaccept_directive( @directives ) >>X<unaccept_directive>
+
+Alias for L<< unaccept_directives >>.
+
+=item C<< $parser->unaccept_directives( @directives ) >>X<unaccept_directives>
+
+Removes C<< @directives >> as valid directives for the parse.
+
+=item C<< $parser->unaccept_target( @targets ) >>X<unaccept_target>
+
+Alias for L<< unaccept_targets >>.
+
+=item C<< $parser->unaccept_targets( @targets ) >>X<unaccept_targets>
+
+Removes C<< @targets >> as valid targets for the parse.
+
+=item C<< $parser->version_report() >>X<version_report>
+
+Returns a string describing the version.
+
+=item C<< $parser->whine( @error_messages ) >>X<whine>
+
+Log an error unless C<< $parser->no_whining( TRUE ); >>.
+
+=back
+
=head1 CAVEATS
This is just a beta release -- there are a good number of things still
=back
+Documentation has been contributed by:
+
+=over
+
+=item * Gabor Szabo C<szabgab@gmail.com>
+
+=item * Shawn H Corey C<SHCOREY at cpan.org>
+
+=back
+
=cut
use strict;
use Carp ();
use vars qw($VERSION );
-$VERSION = '3.16';
+$VERSION = '3.17';
#use constant DEBUG => 7;
BEGIN {
require Pod::Simple;
for(my $i = 2; $i < @$para; $i++) {
foreach my $line ($para->[$i]) { # just for aliasing
# Strip indentation.
- $line =~ s/^\E$indent// if $indent
+ $line =~ s/^\Q$indent// if $indent
&& !($self->{accept_codes} && $self->{accept_codes}{VerbatimFormatted});
while( $line =~
# Sort of adapted from Text::Tabs -- yes, it's hardwired in that
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
-$VERSION = '3.16';
+$VERSION = '3.17';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
package Pod::Simple::Debug;
use strict;
use vars qw($VERSION );
-$VERSION = '3.16';
+$VERSION = '3.17';
sub import {
my($value,$variable);
require 5;
package Pod::Simple::DumpAsText;
-$VERSION = '3.16';
+$VERSION = '3.17';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
require 5;
package Pod::Simple::DumpAsXML;
-$VERSION = '3.16';
+$VERSION = '3.17';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
$Doctype_decl $Content_decl
);
@ISA = ('Pod::Simple::PullParser');
-$VERSION = '3.16';
+$VERSION = '3.17';
BEGIN {
if(defined &DEBUG) { } # no-op
use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION
$CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA
);
-$VERSION = '3.16';
+$VERSION = '3.17';
@ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML!
# TODO: nocontents stylesheets. Strike some of the color variations?
% mkdir out_html
% perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go @INC out_html
(to convert the pod from Perl's @INC
- files under the directory ../htmlversion)
+ files under the directory ./out_html)
(Note that the command line there contains a literal atsign-I-N-C. This
is handled as a special case by batch_convert, in order to save you having
% chmod og-rx ../seekrut
% perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go . ../htmlversion
(to convert the pod under the current dir into HTML
- files under the directory ../htmlversion)
+ files under the directory ./seekrut)
Example:
package Pod::Simple::LinkSection;
# Based somewhat dimly on Array::Autojoin
use vars qw($VERSION );
-$VERSION = '3.16';
+$VERSION = '3.17';
use strict;
use Pod::Simple::BlackBox;
use vars qw($VERSION );
-$VERSION = '3.16';
+$VERSION = '3.17';
use overload( # So it'll stringify nice
'""' => \&Pod::Simple::BlackBox::stringify_lol,
use strict;
use Pod::Simple ();
use vars qw(@ISA $VERSION);
-$VERSION = '3.16';
+$VERSION = '3.17';
@ISA = ('Pod::Simple');
# Yes, we could use named variables, but I want this to be impose
require 5;
package Pod::Simple::Progress;
-$VERSION = '3.16';
+$VERSION = '3.17';
use strict;
# Objects of this class are used for noting progress of an
require 5;
package Pod::Simple::PullParser;
-$VERSION = '3.16';
+$VERSION = '3.17';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
use strict;
use vars qw(@ISA $VERSION);
@ISA = ('Pod::Simple::PullParserToken');
-$VERSION = '3.16';
+$VERSION = '3.17';
sub new { # Class->new(tagname);
my $class = shift;
use strict;
use vars qw(@ISA $VERSION);
@ISA = ('Pod::Simple::PullParserToken');
-$VERSION = '3.16';
+$VERSION = '3.17';
sub new { # Class->new(tagname, optional_attrhash);
my $class = shift;
use strict;
use vars qw(@ISA $VERSION);
@ISA = ('Pod::Simple::PullParserToken');
-$VERSION = '3.16';
+$VERSION = '3.17';
sub new { # Class->new(text);
my $class = shift;
package Pod::Simple::PullParserToken;
# Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token
@ISA = ();
-$VERSION = '3.16';
+$VERSION = '3.17';
use strict;
sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway
use strict;
use vars qw($VERSION @ISA %Escape $WRAP %Tagmap);
-$VERSION = '3.16';
+$VERSION = '3.17';
use Pod::Simple::PullParser ();
BEGIN {@ISA = ('Pod::Simple::PullParser')}
use strict;
use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY);
-$VERSION = '3.16'; ## Current version of this package
+$VERSION = '3.17'; ## Current version of this package
BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level
use Carp ();
#==========================================================================
__PACKAGE__->_accessorize( # Make my dumb accessor methods
'callback', 'progress', 'dir_prefix', 'inc', 'laborious', 'limit_glob',
- 'limit_re', 'shadows', 'verbose', 'name2path', 'path2name',
+ 'limit_re', 'shadows', 'verbose', 'name2path', 'path2name', 'recurse',
);
#==========================================================================
sub init {
my $self = shift;
$self->inc(1);
+ $self->recurse(1);
$self->verbose(DEBUG);
return $self;
}
my $self = $_[0];
# Put the options in variables, for easy access
- my( $laborious, $verbose, $shadows, $limit_re, $callback, $progress,$path2name,$name2path) =
+ my( $laborious, $verbose, $shadows, $limit_re, $callback, $progress,
+ $path2name, $name2path, $recurse) =
map scalar($self->$_()),
- qw(laborious verbose shadows limit_re callback progress path2name name2path);
+ qw(laborious verbose shadows limit_re callback progress
+ path2name name2path recurse);
my($file, $shortname, $isdir, $modname_bits);
return sub {
if($isdir) { # this never gets called on the startdir itself, just subdirs
+ unless( $recurse ) {
+ $verbose and print "Not recursing into '$file' as per requested.\n";
+ return 'PRUNE';
+ }
+
if( $self->{'_dirs_visited'}{$file} ) {
$verbose and print "Directory '$file' already seen, skipping.\n";
return 'PRUNE';
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '3.16';
+$VERSION = '3.17';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
In the most common case, the simple case of a LE<lt>podpageE<gt> code
produces this event structure:
- <L content-implicit="yes" to="Net::Ping" type="pod">
+ <L content-implicit="yes" to="podpage" type="pod">
podpage
</L>
In the unlikely situation that you need to tell the parser that you will
accept additional directives ("=foo" things), you need to first set the
-parset to treat its content as data (i.e., not really processed at
+parser to treat its content as data (i.e., not really processed at
all), or as verbatim (mostly just expanding tabs), or as processed text
(parsing formatting codes like BE<lt>...E<gt>).
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION $FREAKYMODE);
-$VERSION = '3.16';
+$VERSION = '3.17';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
use Carp ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
-$VERSION = '3.16';
+$VERSION = '3.17';
@ISA = ('Pod::Simple');
sub new {
use Symbol ('gensym');
use Carp ();
use vars qw($VERSION );
-$VERSION = '3.16';
+$VERSION = '3.17';
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
require 5;
package Pod::Simple::Transcode;
use vars qw($VERSION );
-$VERSION = '3.16';
+$VERSION = '3.17';
BEGIN {
if(defined &DEBUG) {;} # Okay
package Pod::Simple::TranscodeDumb;
use strict;
use vars qw($VERSION %Supported);
-$VERSION = '3.16';
+$VERSION = '3.17';
# This module basically pretends it knows how to transcode, except
# only for null-transcodings! We use this when Encode isn't
# available.
use Pod::Simple;
require Encode;
use vars qw($VERSION );
-$VERSION = '3.16';
+$VERSION = '3.17';
sub is_dumb {0}
sub is_smart {1}
package Pod::Simple::XHTML;
use strict;
use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES );
-$VERSION = '3.16';
+$VERSION = '3.17';
use Pod::Simple::Methody ();
@ISA = ('Pod::Simple::Methody');
Whether to add a table-of-contents at the top of each page (called an
index for the sake of tradition).
+=head2 anchor_items
+
+Whether to anchor every definition C<=item> directive. This needs to be
+enabled if you want to be able to link to specific C<=item> directives, which
+are output as C<< <dt> >> elements. Disabled by default.
+
+=head2 backlink
+
+Whether to turn every =head1 directive into a link pointing to the top
+of the page (specifically, the opening body tag).
=cut
'html_header',
'html_footer',
'index',
+ 'anchor_items',
+ 'backlink',
'batch_mode', # whether we're in batch mode
'batch_mode_current_level',
# When in batch mode, how deep the current module is: 1 for "LWP",
$new->{'to_index'} = [];
$new->{'output'} = [];
$new->{'saved'} = [];
- $new->{'ids'} = {};
+ $new->{'ids'} = { '_podtop_' => 1 }; # used in <body>
$new->{'in_li'} = [];
$new->{'__region_targets'} = [];
more than just display formatted text. Perhaps adding a way to generate
HTML tables from an extended version of POD.
-So, let's say you want add a custom element called 'foo'. In your
+So, let's say you want to add a custom element called 'foo'. In your
subclass's C<new> method, after calling C<SUPER::new> you'd call:
$new->accept_targets_as_text( 'foo' );
}
sub start_item_text {
- if ($_[0]{'in_dd'}[ $_[0]{'dl_level'} ]) {
- $_[0]{'scratch'} = "</dd>\n";
- $_[0]{'in_dd'}[ $_[0]{'dl_level'} ] = 0;
- }
- $_[0]{'scratch'} .= '<dt>';
+ # see end_item_text
}
sub start_over_bullet { $_[0]{'scratch'} = '<ul>'; push @{$_[0]{'in_li'}}, 0; $_[0]->emit }
my $id = $_[0]->idify($_[0]{scratch});
my $text = $_[0]{scratch};
- $_[0]{'scratch'} = qq{<h$h id="$id">$text</h$h>};
+ $_[0]{'scratch'} = $_[0]->backlink && ($h - $add == 0)
+ # backlinks enabled && =head1
+ ? qq{<a href="#_podtop_"><h$h id="$id">$text</h$h></a>}
+ : qq{<h$h id="$id">$text</h$h>};
$_[0]->emit;
push @{ $_[0]{'to_index'} }, [$h, $id, $text];
}
sub end_item_number { $_[0]{'scratch'} .= '</p>'; $_[0]->emit }
sub end_item_text {
- $_[0]{'scratch'} .= "</dt>\n<dd>";
+ # idify and anchor =item content if wanted
+ my $dt_id = $_[0]{'anchor_items'}
+ ? ' id="'. $_[0]->idify($_[0]{'scratch'}) .'"'
+ : '';
+
+ # reset scratch
+ my $text = $_[0]{scratch};
+ $_[0]{'scratch'} = '';
+
+ if ($_[0]{'in_dd'}[ $_[0]{'dl_level'} ]) {
+ $_[0]{'scratch'} = "</dd>\n";
+ $_[0]{'in_dd'}[ $_[0]{'dl_level'} ] = 0;
+ }
+
+ $_[0]{'scratch'} .= qq{<dt$dt_id>$text</dt>\n<dd>};
$_[0]{'in_dd'}[ $_[0]{'dl_level'} ] = 1;
$_[0]->emit;
}
$self->{'scratch'} .= $self->html_header;
$self->emit unless $self->html_header eq "";
} else {
- my ($doctype, $title, $metatags);
+ my ($doctype, $title, $metatags, $bodyid);
$doctype = $self->html_doctype || '';
$title = $self->force_title || $self->title || $self->default_title || '';
$metatags = $self->html_header_tags || '';
$metatags .= "\n<script type='text/javascript' src='" .
$self->html_javascript . "'></script>";
}
+ $bodyid = $self->backlink ? ' id="_podtop_"' : '';
$self->{'scratch'} .= <<"HTML";
$doctype
<html>
<title>$title</title>
$metatags
</head>
-<body>
+<body$bodyid>
HTML
$self->emit;
}
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '3.16';
+$VERSION = '3.17';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
use strict;
use Pod::Simple::Search;
use Test;
-BEGIN { plan tests => 15 }
+BEGIN { plan tests => 16 }
print "# Some basic sanity tests...\n";
ok defined $x->can('laborious');
ok defined $x->can('limit_glob');
ok defined $x->can('limit_re');
+ok defined $x->can('recurse');
ok defined $x->can('shadows');
ok defined $x->can('verbose');
ok defined $x->can('survey');
use Pod::Simple::Search;
use Test;
-BEGIN { plan tests => 7 }
+BEGIN { plan tests => 11 }
print "# ", __FILE__,
": Testing the surveying of a single specified docroot...\n";
my $x = Pod::Simple::Search->new;
die "Couldn't make an object!?" unless ok defined $x;
-print "# Testing the surveying of the current directory...\n";
+print "# Testing the surveying of a single docroot...\n";
$x->inc(0);
ok grep( m/squaa\.pm/, keys %$where2name ), 1;
+###### Now with recurse(0)
+
+print "# Testing the surveying of a single docroot without recursing...\n";
+
+$x->recurse(0);
+($name2where, $where2name) = $x->survey($here);
+
+$p = pretty( $where2name, $name2where )."\n";
+$p =~ s/, +/,\n/g;
+$p =~ s/^/# /mg;
+print $p;
+
+{
+my $names = join "|", sort values %$where2name;
+ok $names, "Blorm|squaa|zikzik";
+}
+
+{
+my $names = join "|", sort keys %$name2where;
+ok $names, "Blorm|squaa|zikzik";
+}
+
+ok( ($name2where->{'squaa'} || 'huh???'), '/squaa\.pm$/');
+
+ok grep( m/squaa\.pm/, keys %$where2name ), 1;
+
ok 1;
__END__
use strict;
use Pod::Simple::Search;
use Test;
-BEGIN { plan tests => 7 }
+BEGIN { plan tests => 11 }
print "# ", __FILE__,
": Testing the surveying of the current directory...\n";
ok grep( m/squaa\.pm/, keys %$where2name ), 1;
+###### Now with recurse(0)
+
+print "# Testing the surveying of a current directory without recursing...\n";
+
+$x->recurse(0);
+($name2where, $where2name) = $x->survey($cwd);
+
+$p = pretty( $where2name, $name2where )."\n";
+$p =~ s/, +/,\n/g;
+$p =~ s/^/# /mg;
+print $p;
+
+{
+my $names = join "|", sort values %$where2name;
+ok $names, "";
+}
+
+{
+my $names = join "|", sort keys %$name2where;
+ok $names, "";
+}
+
+ok( ($name2where->{'squaa'} || 'huh???'), 'huh???');
+
+ok grep( m/squaa\.pm/, keys %$where2name ), 0;
+
ok 1;
__END__
+
use strict;
use Pod::Simple::Search;
use Test;
-BEGIN { plan tests => 7 }
+BEGIN { plan tests => 11 }
print "# ", __FILE__,
": Testing the scanning of several (well, two) docroots...\n";
ok grep( m/squaa\.pm/, keys %$where2name ), 1;
+###### Now with recurse(0)
+
+$x->recurse(0);
+
+print "# OK, starting run without recurse...\n# [[\n";
+($name2where, $where2name) = $x->survey($here1, $here2);
+print "# ]]\n#OK, run without recurse done.\n";
+
+$p = pretty( $where2name, $name2where )."\n";
+$p =~ s/, +/,\n/g;
+$p =~ s/^/# /mg;
+print $p;
+
+{
+my $names = join "|", sort values %$where2name;
+skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
+ $names,
+ "Blorm|Suzzle|squaa|zikzik";
+}
+
+{
+my $names = join "|", sort keys %$name2where;
+skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
+ $names,
+ "Blorm|Suzzle|squaa|zikzik";
+}
+
+ok( ($name2where->{'squaa'} || 'huh???'), '/squaa\.pm$/');
+
+ok grep( m/squaa\.pm/, keys %$where2name ), 1;
+
ok 1;
__END__
use strict;
use lib '../lib';
-use Test::More tests => 79;
+use Test::More tests => 87;
#use Test::More 'no_plan';
use_ok('Pod::Simple::XHTML') or exit;
"<pre><code>foo bar\nbaz blez</code></pre>\n\n",
'militant code ref'
],
+ [
+ "\n=pod\n\n foo (bar\n baz blez\n",
+ sub { (my $i = $_[0]->[0]) =~ s/S.*//; $i },
+ qq{<Document><Verbatim\nxml:space="preserve">\n baz blez</Verbatim></Document>},
+ "<pre><code>\n baz blez</code></pre>\n\n",
+ 'code ref and paren'
+ ],
) {
my ($pod, $indent, $xml, $xhtml, $desc) = @$spec;
# Test XML output.
use strict;
use lib '../lib';
-use Test::More tests => 44;
+use Test::More tests => 56;
#use Test::More 'no_plan';
use_ok('Pod::Simple::XHTML') or exit;
EOF
+initialize($parser, $results);
+$parser->html_header($header);
+$parser->html_footer($footer);
+$parser->backlink(1);
+ok $parser->parse_string_document( '=head1 Foo' ), 'Parse a header';
+is $results, <<'EOF', 'Should have the index and a backlink';
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body id="_podtop_">
+
+
+<ul id="index">
+ <li><a href="#Foo">Foo</a></li>
+</ul>
+
+<a href="#_podtop_"><h1 id="Foo">Foo</h1></a>
+
+</body>
+</html>
+
+EOF
+
+initialize($parser, $results);
+$parser->html_header($header);
+$parser->html_footer($footer);
+$parser->backlink(1);
+ok $parser->parse_string_document( "=head1 Foo \n\n=head2 Bar \n\n=head1 Baz" ), 'Parse headers';
+is $results, <<'EOF', 'Should have the index and backlinks';
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body id="_podtop_">
+
+
+<ul id="index">
+ <li><a href="#Foo">Foo</a>
+ <ul>
+ <li><a href="#Bar">Bar</a></li>
+ </ul>
+ </li>
+ <li><a href="#Baz">Baz</a></li>
+</ul>
+
+<a href="#_podtop_"><h1 id="Foo">Foo</h1></a>
+
+<h2 id="Bar">Bar</h2>
+
+<a href="#_podtop_"><h1 id="Baz">Baz</h1></a>
+
+</body>
+</html>
+
+EOF
+
+initialize($parser, $results);
+$parser->html_header($header);
+$parser->html_footer($footer);
+$parser->index(0);
+$parser->backlink(1);
+ok $parser->parse_string_document( "=head1 Foo \n\n=head1 Bar" ), 'Parse headers';
+is $results, <<'EOF', 'Should have backlinks but no index';
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body id="_podtop_">
+
+
+<a href="#_podtop_"><h1 id="Foo">Foo</h1></a>
+
+<a href="#_podtop_"><h1 id="Bar">Bar</h1></a>
+
+</body>
+</html>
+
+EOF
+
+initialize($parser, $results);
+$parser->html_header($header);
+$parser->html_footer($footer);
+$parser->backlink(1);
+$parser->html_h_level(2);
+ok $parser->parse_string_document( "=head1 Foo \n\n=head1 Bar" ), 'Parse headers';
+is $results, <<'EOF', 'Should have index and backlinks around h2 elements';
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body id="_podtop_">
+
+
+<ul id="index">
+ <li>
+ <ul>
+ <li><a href="#Foo">Foo</a></li>
+ <li><a href="#Bar">Bar</a></li>
+ </ul>
+ </li>
+</ul>
+
+<a href="#_podtop_"><h2 id="Foo">Foo</h2></a>
+
+<a href="#_podtop_"><h2 id="Bar">Bar</h2></a>
+
+</body>
+</html>
+
+EOF
+
+initialize($parser, $results);
+$parser->anchor_items(1);
+ok $parser->parse_string_document( <<'EOPOD' ), 'Parse POD';
+=head1 Foo
+
+=over
+
+=item test
+
+=item Test 2
+
+body of item
+
+=back
+
+=over
+
+=item *
+
+not anchored
+
+=back
+
+=over
+
+=item 1
+
+still not anchored
+
+=back
+EOPOD
+
+is $results, <<'EOF', 'Anchor =item directives';
+<ul id="index">
+ <li><a href="#Foo">Foo</a></li>
+</ul>
+
+<h1 id="Foo">Foo</h1>
+
+<dl>
+
+<dt id="test">test</dt>
+<dd>
+
+</dd>
+<dt id="Test-2">Test 2</dt>
+<dd>
+
+<p>body of item</p>
+
+</dd>
+</dl>
+
+<ul>
+
+<li><p>not anchored</p>
+
+</li>
+</ul>
+
+<ol>
+
+<li><p>still not anchored</p>
+
+</li>
+</ol>
+
+EOF
+
+initialize($parser, $results);
+$parser->anchor_items(0);
+ok $parser->parse_string_document( <<'EOPOD' ), 'Parse POD';
+=head1 Foo
+
+=over
+
+=item test
+
+=item Test 2
+
+body of item
+
+=back
+
+=over
+
+=item *
+
+not anchored
+
+=back
+
+=over
+
+=item 1
+
+still not anchored
+
+=back
+EOPOD
+is $results, <<'EOF', 'Do not anchor =item directives';
+<ul id="index">
+ <li><a href="#Foo">Foo</a></li>
+</ul>
+
+<h1 id="Foo">Foo</h1>
+
+<dl>
+
+<dt>test</dt>
+<dd>
+
+</dd>
+<dt>Test 2</dt>
+<dd>
+
+<p>body of item</p>
+
+</dd>
+</dl>
+
+<ul>
+
+<li><p>not anchored</p>
+
+</li>
+</ul>
+
+<ol>
+
+<li><p>still not anchored</p>
+
+</li>
+</ol>
+
+EOF
sub initialize {
$_[0] = Pod::Simple::XHTML->new;
$_[0]->html_header('');
=item *
+L<Pod::Simple> has been upgraded from version 3.16 to version 3.17
+
+=item *
+
L<Unicode::Collate> has been upgraded from version 0.76 to version 0.77
Applied [perl #93470] silencing compiler warnings with -Wwrite-strings