'Pod::Simple' =>
{
'MAINTAINER' => 'arandal',
- 'DISTRIBUTION' => 'ARANDAL/Pod-Simple-3.08.tar.gz',
+ 'DISTRIBUTION' => 'DWHEELER/Pod-Simple-3.11.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
# ChangeLog for Pod::Simple dist
#---------------------------------------------------------------------------
+2009-12-09 David E. Wheeler <david@justatheory.org>
+ * Release 3.11
+
+ Restored code to HTMLBatch that allows the TOC (index) to be created
+ in batch jobs (RT #52324 from Martin J. Evans).
+
+ Added resources to META.yml, including bug tracker, license, and
+ repository.
+
+ Turned man page links into links to man.he.net in Pod::Simple::HTML
+ and Pod::Simple::XHTML output. Subclass and override
+ resolve_man_page_link() to use a different URL.
+
+ Added the resolve_pod_page_link() and resolve_man_page_link() methods
+ to Pod::Simple::XHTML to make it easier for subclasses to change the
+ URLs created for POD and man page links.
+
+ Fixed the output of entities in L<> tags by Pod::Simple::XHTML.
+
+ Fixed the output of POD links from Pod::Simple::XHTML so that the
+ section part (/foo) is turned into a proper fragment identfier (#foo)
+ in the resulting search.cpan.org link.
+
+ Pod::Simple::Text now outputs URLs for links created in the
+ L<text|URL> format. For example, L<Perl|http://perl.org> is now
+ output as "Perl <http://perl.org>" rather than just as "Perl".
+
+ Updated perlpod.pod and perlpodspec.pod to sync up with Perl core
+ (and to be released in Perl 5.12). Changes include:
+ * Removing the prohibition against L<text|href>
+ * Deprecation of L<section> and L<"section">
+ * Legalization of "=begin formatname parameter"
+
+ A couple of bug fixes in Pod::Simple::HTML from Graham Barr.
+
+ Added the do_section() method to Pod::Simple::HTML. Graham Barr.
+
+ Word-smithed the "DESCRIPTION" a bit and wrote the README.
+
+ Synced up all module version numbers to 3.11 except for
+ Pod::Simple::HTMLLegacy, which is at 5.01 and should not have its
+ version number lowered.
+
2009-11-12 David E. Wheeler <david@justatheory.org>
- * Release 3.10
+ * Release 3.11
- Converted test files that had DOS enedings to have Unix endings
+ Converted test files that had DOS endings to have Unix endings
(RT #50922 from Steve Hay).
Skip tests on VMS where the lack of filename case preservation can
- Time-stamp: "2003-09-01 23:10:23 ADT"
+=head1 Pod::Simple version 3.11
-This is a late-beta release of Pod::Simple, the module-suite for
-parsing Pod.
+Pod::Simple is a Perl library for parsing text in the Pod ("plain old
+documentation") markup language that is typically used for writing
+documentation for Perl and for Perl modules. The Pod format is explained
+L<perlpod>; the most common formatter is called C<perldoc>.
-There are still some gaps in the documentation, and Pod::Simple::HTML
-isn't yet all that it should be.
+Pod formatters can use Pod::Simple to parse Pod documents and render them into
+plain text, HTML, or any number of other formats.
+
+=head2 Installation
+
+To install this module, type the following:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+=head2 Support
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
+=head1 copyright and Disclaimers
+
+Copyright (c) 2002 Sean M. Burke. All rights reserved.
+
+This library is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+This program is distributed in the hope that it will be useful, but
+without any warranty; without even the implied warranty of
+merchantability or fitness for a particular purpose.
+
+=head1 Author
+
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
+
+Pod::Simple is maintained by:
+
+=over
+
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
);
@ISA = ('Pod::Simple::BlackBox');
-$VERSION = '3.10';
+$VERSION = '3.11';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
# L<text|name/"sec"> or L<text|name/sec>
# L<text|/"sec"> or L<text|/sec> or L<text|"sec">
# L<scheme:...>
- # Ltext|scheme:...>
+ # L<text|scheme:...>
my($self,@stack) = @_;
Pod::Simple is a Perl library for parsing text in the Pod ("plain old
documentation") markup language that is typically used for writing
documentation for Perl and for Perl modules. The Pod format is explained
-in the L<perlpod|perlpod> man page; the most common formatter is called
-"perldoc".
+L<perlpod>; the most common formatter is called C<perldoc>.
-Pod formatters can use Pod::Simple to parse Pod documents into produce
-renderings of them in plain ASCII, in HTML, or in any number of other
-formats. Typically, such formatters will be subclasses of Pod::Simple,
-and so they will inherit its methods, like C<parse_file>.
+Pod formatters can use Pod::Simple to parse Pod documents and render them into
+plain text, HTML, or any number of other formats. Typically, such formatters
+will be subclasses of Pod::Simple, and so they will inherit its methods, like
+C<parse_file>.
If you're reading this document just because you have a Pod-processing
-subclass that you want to use, this document (plus the documentation for
-the subclass) is probably all you'll need to read.
+subclass that you want to use, this document (plus the documentation for the
+subclass) is probably all you need to read.
If you're reading this document because you want to write a formatter
-subclass, continue reading this document, and then read
-L<Pod::Simple::Subclassing>, and then possibly even read L<perlpodspec>
-(some of which is for parser-writers, but much of which is notes to
-formatter-writers).
-
+subclass, continue reading it and then read L<Pod::Simple::Subclassing>, and
+then possibly even read L<perlpodspec> (some of which is for parser-writers,
+but much of which is notes to formatter-writers).
=head1 MAIN METHODS
-
-
=over
=item C<< $parser = I<SomeClass>->new(); >>
L<perldoc>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
=head1 COPYRIGHT AND DISCLAIMERS
=head1 AUTHOR
-Original author: Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-Maintained by:
+Pod::Simple is maintained by:
=over
=item * Hans Dieter Pearcey C<hdp@cpan.org>
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
=back
=cut
-
-
use integer; # vroom!
use strict;
use Carp ();
+use vars qw($VERSION );
+$VERSION = '3.11';
#use constant DEBUG => 7;
BEGIN {
require Pod::Simple;
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
-$VERSION = '2.02';
+$VERSION = '3.11';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
L<Pod::Simple>, L<Pod::Simple::Text>, L<Pod::Checker>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
require 5;
package Pod::Simple::Debug;
use strict;
+use vars qw($VERSION );
+$VERSION = '3.11';
sub import {
my($value,$variable);
The article "Constants in Perl", in I<The Perl Journal> issue
21. See L<http://interglacial.com/tpj/21/>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
require 5;
package Pod::Simple::DumpAsText;
-$VERSION = '2.02';
+$VERSION = '3.11';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
L<Pod::Simple>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
require 5;
package Pod::Simple::DumpAsXML;
-$VERSION = '2.02';
+$VERSION = '3.11';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
The older libraries L<Pod::PXML>, L<Pod::XML>, L<Pod::SAX>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
=head1 COPYRIGHT AND DISCLAIMERS
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
use Pod::Simple::PullParser ();
use vars qw(
@ISA %Tagmap $Computerese $LamePad $Linearization_Limit $VERSION
- $Perldoc_URL_Prefix $Perldoc_URL_Postfix
+ $Perldoc_URL_Prefix $Perldoc_URL_Postfix $Man_URL_Prefix $Man_URL_Postfix
$Title_Prefix $Title_Postfix $HTML_EXTENSION %ToIndex
$Doctype_decl $Content_decl
);
@ISA = ('Pod::Simple::PullParser');
-$VERSION = '3.03';
+$VERSION = '3.11';
use UNIVERSAL ();
BEGIN {
$Perldoc_URL_Postfix = ''
unless defined $Perldoc_URL_Postfix;
+
+$Man_URL_Prefix = 'http://man.he.net/man';
+$Man_URL_Postfix = '';
+
$Title_Prefix = '' unless defined $Title_Prefix;
$Title_Postfix = '' unless defined $Title_Postfix;
%ToIndex = map {; $_ => 1 } qw(head1 head2 head3 head4 ); # item-text
'perldoc_url_postfix',
# what to put after "Foo%3a%3aBar" in the URL. Normally "".
+ 'man_url_prefix',
+ # In turning L<crontab(5)> into http://whatever/man/1/crontab, what
+ # to put before the "1/crontab".
+ 'man_url_postfix',
+ # what to put after the "1/crontab" in the URL. Normally "".
+
'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->perldoc_url_prefix( $Perldoc_URL_Prefix );
$new->perldoc_url_postfix( $Perldoc_URL_Postfix );
+ $new->man_url_prefix( $Man_URL_Prefix );
+ $new->man_url_postfix( $Man_URL_Postfix );
$new->title_prefix( $Title_Prefix );
$new->title_postfix( $Title_Postfix );
$indent = ' ' x $level;
push @out, sprintf
"%s<li class='indexItem indexItem%s'><a href='#%s'>%s</a>",
- $indent, $level, $anchorname, esc($text)
+ $indent, $level, esc($anchorname), esc($text)
;
}
push @out, "</div>\n";
}
my $name = $self->linearize_tokens(@to_unget);
-
+ $name = $self->do_section($name, $token) if defined $name;
+
print $fh "<a ";
print $fh "class='u' href='#___top' title='click to go to top of document'\n"
if $tagname =~ m/^head\d$/s;
next;
}
DEBUG and print " raw text ", $next->text, "\n";
- printf $fh "\n" . $next->text . "\n";
+ print $fh "\n" . $next->text . "\n";
next;
} else {
###########################################################################
#
+sub do_section {
+ my($self, $name, $token) = @_;
+ return $name;
+}
+
sub do_link {
my($self, $token) = @_;
my $type = $token->attr('type');
sub do_url_link { return $_[1]->attr('to') }
-sub do_man_link { return undef }
- # But subclasses are welcome to override this if they have man
- # pages somewhere URL-accessible.
+sub do_man_link {
+ my ($self, $link) = @_;
+ my $to = $link->attr('to');
+ my $frag = $link->attr('section');
+
+ return undef unless defined $to and length $to; # should never happen
+
+ $frag = $self->section_escape($frag)
+ if defined $frag and length($frag .= ''); # (stringify)
+
+ DEBUG and print "Resolving \"$to/$frag\"\n\n";
+
+ return $self->resolve_man_page_link($to, $frag);
+}
sub do_pod_link {
sub section_url_escape { shift->general_url_escape(@_) }
sub pagepath_url_escape { shift->general_url_escape(@_) }
+sub manpage_url_escape { shift->general_url_escape(@_) }
sub general_url_escape {
my($self, $string) = @_;
return;
}
+sub resolve_man_page_link {
+ my ($self, $to, $frag) = @_;
+ my ($page, $section) = $to =~ /^([^(]+)(?:[(](\d+)[)])?$/;
+
+ return undef unless defined $page and length $page;
+ $section ||= 1;
+
+ return $self->man_url_prefix . "$section/"
+ . $self->manpage_url_escape($page)
+ . $self->man_url_postfix;
+}
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub resolve_pod_link_by_table {
maybe override do_beginning do_end
-
-
=head1 SEE ALSO
L<Pod::Simple>, L<Pod::Simple::HTMLBatch>
-
TODO: a corpus of sample Pod input and HTML output? Or common
idioms?
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
=head1 COPYRIGHT AND DISCLAIMERS
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION
$CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA
);
-$VERSION = '3.02';
+$VERSION = '3.11';
@ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML!
# TODO: nocontents stylesheets. Strike some of the color variations?
# Give each class a chance to init the converter:
$page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth)
if $page->can('batch_mode_page_object_init');
+ # Init for the index (TOC), too.
+ $self->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth)
+ if $self->can('batch_mode_page_object_init');
# Now get busy...
$self->makepath($outdir => \@namelets);
L<Pod::Simple>, L<Pod::Simple::HTMLBatch>, L<perlpod>, L<perlpodspec>
+=head1 SUPPORT
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
=head1 COPYRIGHT AND DISCLAIMERS
-Copyright (c) 2004 Sean M. Burke. All rights reserved.
+Copyright (c) 2002 Sean M. Burke. All rights reserved.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
require 5;
package Pod::Simple::LinkSection;
# Based somewhat dimly on Array::Autojoin
+use vars qw($VERSION );
+$VERSION = '3.11';
use strict;
use Pod::Simple::BlackBox;
+use vars qw($VERSION );
+$VERSION = '3.11';
use overload( # So it'll stringify nice
'""' => \&Pod::Simple::BlackBox::stringify_lol,
L<Pod::Simple>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
-Copyright (c) 2002 Sean M. Burke. All rights reserved.
+Copyright (c) 2004 Sean M. Burke. All rights reserved.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
use strict;
use Pod::Simple ();
use vars qw(@ISA $VERSION);
-$VERSION = '2.02';
+$VERSION = '3.11';
@ISA = ('Pod::Simple');
# Yes, we could use named variables, but I want this to be impose
L<Pod::Simple>, L<Pod::Simple::Subclassing>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
require 5;
package Pod::Simple::Progress;
-$VERSION = "1.01";
+$VERSION = '3.11';
use strict;
# Objects of this class are used for noting progress of an
require 5;
package Pod::Simple::PullParser;
-$VERSION = '2.02';
+$VERSION = '3.11';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
L<HTML::TokeParser>, which inspired this.
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+=over
+=item * Allison Randal C<allison@perl.org>
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
JUNK:
sub _old_get_title { # some witchery in here
require 5;
package Pod::Simple::PullParserEndToken;
use Pod::Simple::PullParserToken ();
-@ISA = ('Pod::Simple::PullParserToken');
use strict;
+use vars qw(@ISA $VERSION);
+@ISA = ('Pod::Simple::PullParserToken');
+$VERSION = '3.11';
sub new { # Class->new(tagname);
my $class = shift;
L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+=over
+
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
require 5;
package Pod::Simple::PullParserStartToken;
use Pod::Simple::PullParserToken ();
-@ISA = ('Pod::Simple::PullParserToken');
use strict;
+use vars qw(@ISA $VERSION);
+@ISA = ('Pod::Simple::PullParserToken');
+$VERSION = '3.11';
sub new { # Class->new(tagname, optional_attrhash);
my $class = shift;
L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing>
+=head1 SEE ALSO
+
+L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing>
+
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
require 5;
package Pod::Simple::PullParserTextToken;
use Pod::Simple::PullParserToken ();
-@ISA = ('Pod::Simple::PullParserToken');
use strict;
+use vars qw(@ISA $VERSION);
+@ISA = ('Pod::Simple::PullParserToken');
+$VERSION = '3.11';
sub new { # Class->new(text);
my $class = shift;
L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+=over
+
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
package Pod::Simple::PullParserToken;
# Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token
@ISA = ();
-$VERSION = '2.02';
+$VERSION = '3.11';
use strict;
sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway
L<Pod::Simple::PullParser> and L<Pod::Simple>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
use strict;
use vars qw($VERSION @ISA %Escape $WRAP %Tagmap);
-$VERSION = '2.02';
+$VERSION = '3.11';
use Pod::Simple::PullParser ();
BEGIN {@ISA = ('Pod::Simple::PullParser')}
L<Pod::Simple>, L<RTF::Writer>, L<RTF::Cookbook>, L<RTF::Document>,
L<RTF::Generator>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
use strict;
use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY);
-$VERSION = 3.04; ## Current version of this package
+$VERSION = '3.11'; ## Current version of this package
BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level
use Carp ();
Returns true if the supplied filename (not POD module) contains some Pod
documentation.
+=head1 SUPPORT
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
+=head1 COPYRIGHT AND DISCLAIMERS
+
+Copyright (c) 2002 Sean M. Burke. All rights reserved.
+
+This library is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+This program is distributed in the hope that it will be useful, but
+without any warranty; without even the implied warranty of
+merchantability or fitness for a particular purpose.
=head1 AUTHOR
-Sean M. Burke E<lt>sburke@cpan.orgE<gt>
-borrowed code from
-Marek Rouchal's Pod::Find, which in turn
-heavily borrowed code from Nick Ing-Simmons' PodToHtml.
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org> with code borrowed
+from Marek Rouchal's L<Pod::Find>, which in turn heavily borrowed code from
+Nick Ing-Simmons' C<PodToHtml>.
-Tim Jenness E<lt>t.jenness@jach.hawaii.eduE<gt> provided
-C<find> and C<contains_pod> to Pod::Find.
+But don't bother him, he's retired.
-=head1 SEE ALSO
+Pod::Simple is maintained by:
-L<Pod::Simple>, L<Pod::Perldoc>
+=over
-=cut
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+=back
+
+=cut
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '2.02';
+$VERSION = '3.11';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
L<The "Tree" subsubsection in XML::Parser|XML::Parser/"Tree">
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
L<perldoc>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
=head1 COPYRIGHT AND DISCLAIMERS
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
+
+Pod::Simple is maintained by:
+
+=over
+
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
=for notes
Hm, my old podchecker version (1.2) says:
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION $FREAKYMODE);
-$VERSION = '2.02';
+$VERSION = '3.11';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
sub end_item_bullet { $_[0]->emit_par( 0) }
sub end_item_number { $_[0]->emit_par( 0) }
sub end_item_text { $_[0]->emit_par(-2) }
+sub start_L { $_[0]{'Link'} = $_[1] if $_[1]->{type} eq 'url' }
+sub end_L {
+ if (my $link = delete $_[0]{'Link'}) {
+ # Append the URL to the output unless it's already present.
+ $_[0]{'Thispara'} .= " <$link->{to}>"
+ unless $_[0]{'Thispara'} =~ /\b\E$link->{to}/;
+ }
+}
sub emit_par {
my($self, $tweak_indent) = splice(@_,0,2);
L<Pod::Simple>, L<Pod::Simple::TextContent>, L<Pod::Text>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+=over
+
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
use Carp ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
-$VERSION = '2.02';
+$VERSION = '3.11';
@ISA = ('Pod::Simple');
sub new {
L<Pod::Simple>, L<Pod::Simple::Text>, L<Pod::Spell>
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke. All rights reserved.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+
+=over
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
package Pod::Simple::TiedOutFH;
use Symbol ('gensym');
use Carp ();
+use vars qw($VERSION );
+$VERSION = '3.11';
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
require 5;
package Pod::Simple::Transcode;
+use vars qw($VERSION );
+$VERSION = '3.11';
BEGIN {
if(defined &DEBUG) {;} # Okay
package Pod::Simple::TranscodeDumb;
use strict;
use vars qw($VERSION %Supported);
-$VERSION = '2.02';
+$VERSION = '3.11';
# This module basically pretends it knows how to transcode, except
# only for null-transcodings! We use this when Encode isn't
# available.
use strict;
use Pod::Simple;
require Encode;
+use vars qw($VERSION );
+$VERSION = '3.11';
sub is_dumb {0}
sub is_smart {1}
package Pod::Simple::XHTML;
use strict;
use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES );
-$VERSION = '3.10';
+$VERSION = '3.11';
use Carp ();
use Pod::Simple::Methody ();
@ISA = ('Pod::Simple::Methody');
What to put after "Foo%3a%3aBar" in the URL. This option is not set by
default.
+=head2 man_url_prefix
+
+In turning C<< L<crontab(5)> >> into http://whatever/man/1/crontab, what
+to put before the "1/crontab". The default value is
+"http://man.he.net/man".
+
+=head2 man_url_postfix
+
+What to put after "1/crontab" in the URL. This option is not set by default.
+
=head2 title_prefix, title_postfix
What to put before and after the title in the head. The values should
__PACKAGE__->_accessorize(
'perldoc_url_prefix',
'perldoc_url_postfix',
+ 'man_url_prefix',
+ 'man_url_postfix',
'title_prefix', 'title_postfix',
'html_css',
'html_javascript',
$new->{'output_fh'} ||= *STDOUT{IO};
$new->accept_targets( 'html', 'HTML' );
$new->perldoc_url_prefix('http://search.cpan.org/perldoc?');
+ $new->man_url_prefix('http://man.he.net/man');
$new->html_header_tags('<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />');
$new->nix_X_codes(1);
$new->codes_in_verbatim(1);
sub start_C { $_[0]{'scratch'} .= '<code>' }
sub end_C { $_[0]{'scratch'} .= '</code>' }
-sub start_E {
- my ($self, $flags) = @_;
- push @{ $self->{'saved'} }, $self->{'scratch'};
- $self->{'scratch'} = '';
-}
-sub end_E {
- my ($self, $flags) = @_;
- my $previous = pop @{ $self->{'saved'} };
- my $entity = $self->{'scratch'};
-
- if ($entity =~ 'sol' or $entity =~ 'verbar') {
- my $char = Pod::Escapes::e2char($entity);
- if (defined($char)) {
- $self->{'scratch'} = $previous . $char;
- return;
- }
- }
-
- if ($entity =~ /^[0-9]/) {
- $entity = '#' . $entity;
- }
-
- $self->{'scratch'} = $previous . '&'. $entity . ';'
-}
-
sub start_F { $_[0]{'scratch'} .= '<i>' }
sub end_F { $_[0]{'scratch'} .= '</i>' }
sub start_I { $_[0]{'scratch'} .= '<i>' }
sub end_I { $_[0]{'scratch'} .= '</i>' }
-sub start_L {
+sub start_L {
my ($self, $flags) = @_;
- my $url;
- if ($flags->{'type'} eq 'url') {
- $url = $flags->{'to'};
- } elsif ($flags->{'type'} eq 'pod') {
- $url .= $self->perldoc_url_prefix || '';
- $url .= $flags->{'to'} || '';
- $url .= '/' . $flags->{'section'} if ($flags->{'section'});
- $url .= $self->perldoc_url_postfix || '';
-# require Data::Dumper;
-# print STDERR Data::Dumper->Dump([$flags]);
- }
-
- $self->{'scratch'} .= '<a href="'. $url . '">';
+ my ($type, $to, $section) = @{$flags}{'type', 'to', 'section'};
+ my $url = $type eq 'url' ? $to
+ : $type eq 'pod' ? $self->resolve_pod_page_link($to, $section)
+ : $type eq 'man' ? $self->resolve_man_page_link($to, $section)
+ : undef;
+
+ # If it's an unknown type, use an attribute-less <a> like HTML.pm.
+ $self->{'scratch'} .= '<a' . ($url ? ' href="'. $url . '">' : '>');
}
+
sub end_L { $_[0]{'scratch'} .= '</a>' }
sub start_S { $_[0]{'scratch'} .= '<nobr>' }
return;
}
+=head2 resolve_pod_page_link
+
+ my $url = $pod->resolve_pod_page_link('Net::Ping', 'INSTALL');
+ my $url = $pod->resolve_pod_page_link('perlpodspec');
+ my $url = $pod->resolve_pod_page_link(undef, 'SYNOPSIS');
+
+Resolves a POD link target (typically a module or POD file name) and section
+name to a URL. The resulting link will be returned for the above examples as:
+
+ http://search.cpan.org/perldoc?Net::Ping#INSTALL
+ http://search.cpan.org/perldoc?perlpodspec
+ #SYNOPSIS
+
+Note that when there is only a section argument the URL will simply be a link
+to a section in the current document.
+
+=cut
+
+sub resolve_pod_page_link {
+ my ($self, $to, $section) = @_;
+ return undef unless defined $to || defined $section;
+ if (defined $section) {
+ $section = '#' . $self->idify($section, 1);
+ return $section unless defined $to;
+ } else {
+ $section = ''
+ }
+
+ return ($self->perldoc_url_prefix || '')
+ . encode_entities($to) . $section
+ . ($self->perldoc_url_postfix || '');
+}
+
+=head2 resolve_man_page_link
+
+ my $url = $pod->resolve_man_page_link('crontab(5)', 'EXAMPLE CRON FILE');
+ my $url = $pod->resolve_man_page_link('crontab');
+
+Resolves a man page link target and numeric section to a URL. The resulting
+link will be returned for the above examples as:
+
+ http://man.he.net/man5/crontab
+ http://man.he.net/man1/crontab
+
+Note that the first argument is required. The section number will be parsed
+from it, and if it's missing will default to 1. The second argument is
+currently ignored, as L<man.he.net|http://man.he.net> does not currently
+include linkable IDs or anchor names in its pages. Subclass to link to a
+different man page HTTP server.
+
+=cut
+
+sub resolve_man_page_link {
+ my ($self, $to, $section) = @_;
+ return undef unless defined $to;
+ my ($page, $part) = $to =~ /^([^(]+)(?:[(](\d+)[)])?$/;
+ return undef unless $page;
+ return ($self->man_url_prefix || '')
+ . ($part || 1) . "/" . encode_entities($page)
+ . ($self->man_url_postfix || '');
+
+}
+
=head2 idify
my $id = $pod->idify($text);
return "$t$i";
}
-# Bypass built-in E<> handling to preserve entity encoding
-sub _treat_Es {}
-
1;
__END__
L<Pod::Simple>, L<Pod::Simple::Methody>
-=head1 COPYRIGHT
+=head1 SEE ALSO
+
+L<Pod::Simple>, L<Pod::Simple::Text>, L<Pod::Spell>
+
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
+
+=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2003-2005 Allison Randal.
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
+This library is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
-This library is distributed in the hope that it will be useful, but
+This program is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.
=head1 AUTHOR
-Allison Randal <allison@perl.org>
+Pod::Simpele::XHTML was created by Allison Randal <allison@perl.org>.
-=cut
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
+
+Pod::Simple is maintained by:
+
+=over
+
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+=back
+
+=cut
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '2.02';
+$VERSION = '3.11';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
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>
+
+=head1 SUPPORT
+
+Questions or discussion about POD and Pod::Simple should be sent to the
+pod-people@perl.org mail list. Send an empty email to
+pod-people-subscribe@perl.org to subscribe.
+
+This module is managed in an open GitHub repository,
+L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/theory/pod-simple.git> and send patches!
+
+Patches against Pod::Simple are welcome. Please send bug reports to
+<bug-pod-simple@rt.cpan.org>.
=head1 COPYRIGHT AND DISCLAIMERS
-Copyright (c) 2002-4 Sean M. Burke. All rights reserved.
+Copyright (c) 2002-2004 Sean M. Burke. All rights reserved.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 AUTHOR
-Sean M. Burke C<sburke@cpan.org>
+Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
+But don't bother him, he's retired.
-=cut
+Pod::Simple is maintained by:
+=over
+
+=item * Allison Randal C<allison@perl.org>
+
+=item * Hans Dieter Pearcey C<hdp@cpan.org>
+
+=item * David E. Wheeler C<dwheeler@cpan.org>
+
+=back
+
+=cut
use strict;
use Test;
-BEGIN { plan tests => 14 };
+BEGIN { plan tests => 80 };
#use Pod::Simple::Debug (6);
END
);
+$x = 'Pod::Simple::Text';
+# Test text output of links.
+ok(
+ $x->_out(qq{=pod\n\nL<Net::Ping>\n}),
+ " Net::Ping\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nBe sure to read the L<Net::Ping> docs\n}),
+ " Be sure to read the Net::Ping docs\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<http://www.perl.com>\n}),
+ " http://www.perl.com\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<crontab(5)>\n}),
+ " crontab(5)\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<Net::Ping/Ping-pong>\n}),
+ qq{ "Ping-pong" in Net::Ping\n\n}
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL</"Object Methods">\n}),
+ qq{ "Object Methods"\n\n}
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL</Object Methods>\n}),
+ qq{ "Object Methods"\n\n}
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<"Object Methods">\n}),
+ qq{ "Object Methods"\n\n}
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<Net::Ping/Ping-E<112>ong>\n}),
+ qq{ "Ping-pong" in Net::Ping\n\n}
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<news:comp.lang.perl.misc>\n}),
+ " news:comp.lang.perl.misc\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<http://www.perl.org>\n}),
+ " http://www.perl.org\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nSee L<http://www.perl.org>\n}),
+ " See http://www.perl.org\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/>\n}),
+ " http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<news:compE<46>lang.perl.misc>\n}),
+ " news:comp.lang.perl.misc\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<http://wwwE<46>perl.org>\n}),
+ " http://www.perl.org\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<things|crontab(5)>\n}),
+ " things\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<things|crontab(5)/ENVIRONMENT>\n}),
+ " things\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<Perl Error Messages|perldiag>\n}),
+ " Perl Error Messages\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<Perl\nError\nMessages|perldiag>\n}),
+ " Perl Error Messages\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<Perl\nError\t Messages|perldiag>\n}),
+ " Perl Error Messages\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nL<perl.org|http://www.perl.org>\n}),
+ " perl.org <http://www.perl.org>\n\n"
+);
+
+ok(
+ $x->_out(qq{=pod\n\nSee L<perl.org|http://www.perl.org>\n}),
+ " See perl.org <http://www.perl.org>\n\n"
+);
+
+
+# Test HTML output of links.
+use Pod::Simple::HTML;
+my $PERLDOC = "http://search.cpan.org/perldoc";
+my $MANURL = "http://man.he.net/man";
+sub x ($) {
+ Pod::Simple::HTML->_out(
+ sub { $_[0]->bare_output(1) },
+ "=pod\n\n$_[0]",
+ )
+}
+
+ok(
+ x(qq{L<Net::Ping>\n}),
+ qq{\n<p><a href="$PERLDOC?Net%3A%3APing" class="podlinkpod"\n>Net::Ping</a></p>\n}
+);
+
+ok(
+ x(qq{Be sure to read the L<Net::Ping> docs\n}),
+ qq{\n<p>Be sure to read the <a href="$PERLDOC?Net%3A%3APing" class="podlinkpod"\n>Net::Ping</a> docs</p>\n}
+);
+
+ok(
+ x(qq{L<http://www.perl.com>\n}),
+ qq{\n<p><a href="http://www.perl.com" class="podlinkurl"\n>http://www.perl.com</a></p>\n}
+);
+
+ok(
+ x(qq{L<crontab(5)>\n}),
+ qq{\n<p><a href="${MANURL}5/crontab" class="podlinkman"\n>crontab(5)</a></p>\n}
+);
+
+ok(
+ x(qq{L<Net::Ping/Ping-pong>\n}),
+ qq{\n<p><a href="$PERLDOC?Net%3A%3APing#Ping-pong" class="podlinkpod"\n>"Ping-pong" in Net::Ping</a></p>\n}
+);
+
+ok(
+ x(qq{L</"Object Methods">\n}),
+ qq{\n<p><a href="#Object_Methods" class="podlinkpod"\n>"Object Methods"</a></p>\n}
+);
+
+ok(
+ x(qq{L</Object Methods>\n}),
+ qq{\n<p><a href="#Object_Methods" class="podlinkpod"\n>"Object Methods"</a></p>\n}
+);
+
+ok(
+ x(qq{L<"Object Methods">\n}),
+ qq{\n<p><a href="#Object_Methods" class="podlinkpod"\n>"Object Methods"</a></p>\n}
+);
+
+ok(
+ x(qq{L<Net::Ping/Ping-E<112>ong>\n}),
+ qq{\n<p><a href="$PERLDOC?Net%3A%3APing#Ping-pong" class="podlinkpod"\n>"Ping-pong" in Net::Ping</a></p>\n}
+);
+
+ok(
+ x(qq{L<news:comp.lang.perl.misc>\n}),
+ qq{\n<p><a href="news:comp.lang.perl.misc" class="podlinkurl"\n>news:comp.lang.perl.misc</a></p>\n}
+);
+
+ok(
+ x(qq{L<http://www.perl.org>\n}),
+ qq{\n<p><a href="http://www.perl.org" class="podlinkurl"\n>http://www.perl.org</a></p>\n}
+);
+
+ok(
+ x(qq{See L<http://www.perl.org>\n}),
+ qq{\n<p>See <a href="http://www.perl.org" class="podlinkurl"\n>http://www.perl.org</a></p>\n}
+);
+
+ok(
+ x(qq{L<http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/>\n}),
+ qq{\n<p><a href="http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/" class="podlinkurl"\n>http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/</a></p>\n}
+);
+
+ok(
+ x(qq{L<news:compE<46>lang.perl.misc>\n}),
+ qq{\n<p><a href="news:comp.lang.perl.misc" class="podlinkurl"\n>news:comp.lang.perl.misc</a></p>\n}
+);
+
+ok(
+ x(qq{L<http://wwwE<46>perl.org>\n}),
+ qq{\n<p><a href="http://www.perl.org" class="podlinkurl"\n>http://www.perl.org</a></p>\n}
+);
+
+ok(
+ x(qq{L<things|crontab(5)>\n}),
+ qq{\n<p><a href="${MANURL}5/crontab" class="podlinkman"\n>things</a></p>\n}
+);
+
+ok(
+ x(qq{L<things|crontab(5)/ENVIRONMENT>\n}),
+ qq{\n<p><a href="${MANURL}5/crontab" class="podlinkman"\n>things</a></p>\n}
+);
+
+ok(
+ x(qq{L<Perl Error Messages|perldiag>\n}),
+ qq{\n<p><a href="$PERLDOC?perldiag" class="podlinkpod"\n>Perl Error Messages</a></p>\n}
+);
+
+ok(
+ x(qq{L<Perl\nError\nMessages|perldiag>\n}),
+ qq{\n<p><a href="$PERLDOC?perldiag" class="podlinkpod"\n>Perl Error Messages</a></p>\n}
+);
+
+ok(
+ x(qq{L<Perl\nError\t Messages|perldiag>\n}),
+ qq{\n<p><a href="$PERLDOC?perldiag" class="podlinkpod"\n>Perl Error Messages</a></p>\n}
+);
+
+ok(
+ x(qq{L<perl.org|http://www.perl.org>\n}),
+ qq{\n<p><a href="http://www.perl.org" class="podlinkurl"\n>perl.org</a></p>\n}
+);
+
+ok(
+ x(qq{See L<perl.org|http://www.perl.org>\n}),
+ qq{\n<p>See <a href="http://www.perl.org" class="podlinkurl"\n>perl.org</a></p>\n}
+);
+
+# Test link output in XHTML.
+use Pod::Simple::XHTML;
+sub o ($) {
+ my $p = Pod::Simple::XHTML->new;
+ $p->html_header("");
+ $p->html_footer("");
+ my $results = '';
+ $p->output_string( \$results ); # Send the resulting output to a string
+ $p->parse_string_document("=pod\n\n$_[0]");
+ return $results;
+}
+
+ok(
+ o(qq{L<Net::Ping>}),
+ qq{<p><a href="$PERLDOC?Net::Ping">Net::Ping</a></p>\n\n}
+);
+
+ok(
+ o(qq{Be sure to read the L<Net::Ping> docs}),
+ qq{<p>Be sure to read the <a href="$PERLDOC?Net::Ping">Net::Ping</a> docs</p>\n\n}
+);
+
+ok(
+ o(qq{L<http://www.perl.com>}),
+ qq{<p><a href="http://www.perl.com">http://www.perl.com</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<crontab(5)>}),
+ qq{<p><a href="${MANURL}5/crontab">crontab(5)</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<Net::Ping/Ping-pong>}),
+ qq{<p><a href="$PERLDOC?Net::Ping#Ping-pong">"Ping-pong" in Net::Ping</a></p>\n\n}
+);
+
+ok(
+ o(qq{L</"Object Methods">}),
+ qq{<p><a href="#Object-Methods">"Object Methods"</a></p>\n\n}
+);
+
+ok(
+ o(qq{L</Object Methods>}),
+ qq{<p><a href="#Object-Methods">"Object Methods"</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<"Object Methods">}),
+ qq{<p><a href="#Object-Methods">"Object Methods"</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<Net::Ping/Ping-E<112>ong>}),
+ qq{<p><a href="$PERLDOC?Net::Ping#Ping-pong">"Ping-pong" in Net::Ping</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<news:comp.lang.perl.misc>}),
+ qq{<p><a href="news:comp.lang.perl.misc">news:comp.lang.perl.misc</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<http://www.perl.org>}),
+ qq{<p><a href="http://www.perl.org">http://www.perl.org</a></p>\n\n}
+);
+
+ok(
+ o(qq{See L<http://www.perl.org>}),
+ qq{<p>See <a href="http://www.perl.org">http://www.perl.org</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/>}),
+ qq{<p><a href="http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/">http://www.perl.org/CPAN/authors/id/S/SB/SBURKE/</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<news:compE<46>lang.perl.misc>}),
+ qq{<p><a href="news:comp.lang.perl.misc">news:comp.lang.perl.misc</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<http://wwwE<46>perl.org>}),
+ qq{<p><a href="http://www.perl.org">http://www.perl.org</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<things|crontab(5)>}),
+ qq{<p><a href="${MANURL}5/crontab">things</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<things|crontab(5)/ENVIRONMENT>}),
+ qq{<p><a href="${MANURL}5/crontab">things</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<Perl Error Messages|perldiag>}),
+ qq{<p><a href="$PERLDOC?perldiag">Perl Error Messages</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<Perl\nError\nMessages|perldiag>}),
+ qq{<p><a href="$PERLDOC?perldiag">Perl Error Messages</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<Perl\nError\t Messages|perldiag>}),
+ qq{<p><a href="$PERLDOC?perldiag">Perl Error Messages</a></p>\n\n}
+);
+
+ok(
+ o(qq{L<perl.org|http://www.perl.org>}),
+ qq{<p><a href="http://www.perl.org">perl.org</a></p>\n\n}
+);
+
+ok(
+ o(qq{See L<perl.org|http://www.perl.org>}),
+ qq{<p>See <a href="http://www.perl.org">perl.org</a></p>\n\n}
+);
+
print "# Wrapping up... one for the road...\n";
ok 1;
print "# --- Done with ", __FILE__, " --- \n";
use strict;
use Test;
-BEGIN { plan tests => 9 };
+BEGIN { plan tests => 10 };
#use Pod::Simple::Debug (10);
"heading building"
);
-print x("=over 4\n\n=item one\n\n=item two\n\nHello\n\n=back\n");
ok(
x("=over 4\n\n=item one\n\n=item two\n\nHello\n\n=back\n"),
q{
}
);
+# Check subclass.
+SUBCLASS: {
+ package My::Pod::HTML;
+ use vars '@ISA', '$VERSION';
+ @ISA = ('Pod::Simple::HTML');
+ $VERSION = '0.01';
+ sub do_section { 'howdy' }
+}
+
+ok(
+ My::Pod::HTML->_out(
+ sub{ $_[0]->bare_output(1) },
+ "=pod\n\n=over\n\n=item Foo\n\n",
+ ),
+ "\n<dl>\n<dt><a name=\"howdy\"\n>Foo</a></dt>\n</dl>\n",
+);
print "# And one for the road...\n";
ok 1;
#sub Pod::Simple::HTMLBatch::DEBUG () {5};
use Test;
-BEGIN { plan tests => 9 }
+BEGIN { plan tests => 17 }
require Pod::Simple::HTMLBatch;;
print "# Converting $corpus_dir => $outdir\n" if $DEBUG;
my $conv = Pod::Simple::HTMLBatch->new;
$conv->verbose(0);
+$conv->index(1);
$conv->batch_convert( [$corpus_dir], $outdir );
ok 1;
print "# OK, back from converting.\n" if $DEBUG;
my @files;
use File::Find;
-find( sub { push @files, $File::Find::name; return }, $outdir );
+find( sub {
+ push @files, $File::Find::name;
+ if (/[.]html$/ && $_ !~ /perl|index/) {
+ # Make sure an index was generated.
+ open HTML, $_ or die "Cannot open $_: $!\n";
+ my $html = do { local $/; <HTML> };
+ close HTML;
+ ok $html =~ /<div class='indexgroup'>/;
+ }
+ return;
+}, $outdir );
{
my $long = ( grep m/zikzik\./i, @files )[0];
ok 1;
}
-
-
# use Pod::Simple;
# *pretty = \&Pod::Simple::BlackBox::pretty;
print "# Wrapping up... one for the road...\n";
ok 1;
print "# --- Done with ", __FILE__, " --- \n";
-
use strict;
use lib '../lib';
-use Test::More tests => 35;
+use Test::More tests => 43;
+#use Test::More 'no_plan';
use_ok('Pod::Simple::XHTML') or exit;
my $results;
-my $PERLDOC = "http://search.cpan.org/perldoc?";
+my $PERLDOC = "http://search.cpan.org/perldoc";
+my $MANURL = "http://man.he.net/man";
initialize($parser, $results);
$parser->parse_string_document( "=head1 Poit!" );
A plain paragraph with a L<Newlines>.
EOPOD
is($results, <<"EOHTML", "Link entity in a paragraph");
-<p>A plain paragraph with a <a href="${PERLDOC}Newlines">Newlines</a>.</p>
+<p>A plain paragraph with a <a href="$PERLDOC?Newlines">Newlines</a>.</p>
EOHTML
A plain paragraph with a L<perlport/Newlines>.
EOPOD
is($results, <<"EOHTML", "Link entity in a paragraph");
-<p>A plain paragraph with a <a href="${PERLDOC}perlport/Newlines">"Newlines" in perlport</a>.</p>
+<p>A plain paragraph with a <a href="$PERLDOC?perlport#Newlines">"Newlines" in perlport</a>.</p>
EOHTML
EOPOD
is($results, <<"EOHTML", "Text with numeric entities");
-<p>A text paragraph using numeric POD entities: <, >.</p>
+<p>A text paragraph using numeric POD entities: <, >.</p>
EOHTML
like $results, qr{<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />},
'Should have proper http-equiv meta tag';
+# Test the link generation methods.
+is $parser->resolve_pod_page_link('Net::Ping', 'INSTALL'),
+ "$PERLDOC?Net::Ping#INSTALL",
+ 'POD link with fragment';
+is $parser->resolve_pod_page_link('perlpodspec'),
+ "$PERLDOC?perlpodspec", 'Simple POD link';
+is $parser->resolve_pod_page_link(undef, 'SYNOPSIS'), '#SYNOPSIS',
+ 'Simple fragment link';
+is $parser->resolve_pod_page_link(undef, 'this that'), '#this-that',
+ 'Fragment link with space';
+is $parser->resolve_pod_page_link('perlpod', 'this that'),
+ "$PERLDOC?perlpod#this-that",
+ 'POD link with fragment with space';
+
+is $parser->resolve_man_page_link('crontab(5)', 'EXAMPLE CRON FILE'),
+ "${MANURL}5/crontab", 'Man link with fragment';
+is $parser->resolve_man_page_link('crontab(5)'),
+ "${MANURL}5/crontab", 'Man link without fragment';
+is $parser->resolve_man_page_link('crontab'),
+ "${MANURL}1/crontab", 'Man link without section';
+
######################################
sub initialize {