MetaCPAN-Pod-XHTML
view release on metacpan or search on metacpan
HTML as is used by MetaCPAN.
- Pod::Simple::Role::StripVerbatimIndent strips indentation from
verbatim blocks, while not breaking tab indents. This is a new
feature.
- added tests
- added documentation
0.001002 - 2017-12-06
- list HTML::Entities as a prerequisite
- use more accurate Pod::Simple::XHTML prereq
0.001001 - 2017-12-02
- Initial release extracted from MetaCPAN Server
NAME
MetaCPAN::Pod::XHTML - Format Pod as HTML for MetaCPAN
SYNOPSIS
my $parser = MetaCPAN::Pod::XHTML->new;
$parser->link_mappings({
'Pod::Simple::Subclassing' => '/pod/distribution/Pod-Simple/lib/Pod/Simple/Subclassing.pod',
});
$parser->output_string(\my $html);
$parser->parse_string_document($pod);
DESCRIPTION
This is a subclass of Pod::Simple::XHTML with improved header linking,
link overrides, and errata included in the HTML. Used internally by
MetaCPAN.
ROLES
The behavior of this subclass is implemented through reusable roles:
* Pod::Simple::Role::XHTML::WithLinkMappings
* Pod::Simple::Role::XHTML::WithExtraTargets
CONTRIBUTORS
* Olaf Alders <olaf@wundersolutions.com>
* Randy Stauner <randy@magnificent-tears.com>
* Moritz Onken <onken@netcubed.de>
* Grant McLean <grant@mclean.net.nz>
COPYRIGHT
Copyright (c) 2017 the MetaCPAN::Pod::XHTML "AUTHOR" and "CONTRIBUTORS"
as listed above.
LICENSE
This library is free software and may be distributed under the same
terms as perl itself. See <http://dev.perl.org/licenses/>.
lib/MetaCPAN/Pod/XHTML.pm view on Meta::CPAN
sub BUILD {
my $self = shift;
$self->anchor_items(1);
}
1;
__END__
=head1 NAME
MetaCPAN::Pod::XHTML - Format Pod as HTML for MetaCPAN
=head1 SYNOPSIS
my $parser = MetaCPAN::Pod::XHTML->new;
$parser->link_mappings({
'Pod::Simple::Subclassing' => '/pod/distribution/Pod-Simple/lib/Pod/Simple/Subclassing.pod',
});
$parser->output_string(\my $html);
$parser->parse_string_document($pod);
=head1 DESCRIPTION
This is a subclass of Pod::Simple::XHTML with improved header linking, link
overrides, and errata included in the HTML. Used internally by MetaCPAN.
=head1 ROLES
The behavior of this subclass is implemented through reusable roles:
=over 4
=item *
lib/MetaCPAN/Pod/XHTML.pm view on Meta::CPAN
Moritz Onken <onken@netcubed.de>
=item *
Grant McLean <grant@mclean.net.nz>
=back
=head1 COPYRIGHT
Copyright (c) 2017 the MetaCPAN::Pod::XHTML L</AUTHOR> and L</CONTRIBUTORS>
as listed above.
=head1 LICENSE
This library is free software and may be distributed under the same terms
as perl itself. See L<http://dev.perl.org/licenses/>.
=cut
lib/Pod/Simple/Role/XHTML/WithAccurateTargets.pm view on Meta::CPAN
package Pod::Simple::Role::XHTML::WithAccurateTargets;
use Moo::Role;
our $VERSION = '0.003002';
$VERSION =~ tr/_//d;
use Pod::Simple::XHTML ();
use namespace::clean;
sub idify {
my ( $self, $t, $not_unique ) = @_;
$t =~ s/^\s+//;
$t =~ s/\s+$//;
$t =~ s/[\s-]+/-/g;
lib/Pod/Simple/Role/XHTML/WithExtraTargets.pm view on Meta::CPAN
package Pod::Simple::Role::XHTML::WithExtraTargets;
use Moo::Role;
our $VERSION = '0.003002';
$VERSION =~ tr/_//d;
use HTML::Entities qw(decode_entities encode_entities);
use URL::Encode qw(url_encode_utf8);
use Pod::Simple::XHTML ();
use constant BAD_LINK_ENCODING => !defined &Pod::Simple::XHTML::decode_entities;
use namespace::clean;
with qw(Pod::Simple::Role::XHTML::WithPostProcess);
# we're using around to ensure proper ordering when combined with
# RepairLinkEncoding
around _end_head => sub {
lib/Pod/Simple/Role/XHTML/WithPostProcess.pm view on Meta::CPAN
after reinit => sub {
my $self = shift;
$self->{__buffer} = '';
};
1;
__END__
=head1 NAME
Pod::Simple::Role::XHTML::WithPostProcess - Post process entire output from XHTML conversion
=head1 SYNOPSIS
package MyPodParser;
with 'Pod::Simple::Role::XHTML::WithPostProcess';
around post_process => sub {
my ($self, $content) = @_;
$content =~ s/Foo/Bar/g;
return $content;
( run in 1.173 second using v1.01-cache-2.11-cpan-49f99fa48dc )