MetaCPAN-Pod-HTML

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      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

README  view on Meta::CPAN


SYNOPSIS
      my $parser = MetaCPAN::Pod::HTML->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, errata included in the HTML, and producing HTML5. Used
    internally by MetaCPAN.

ROLES
    The behavior of this subclass is implemented through reusable roles:

    *   Pod::Simple::Role::XHTML::HTML5

    *   Pod::Simple::Role::XHTML::WithLinkMappings

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/Pod/Simple/Role/XHTML/WithAccurateTargets.pm  view on Meta::CPAN

package Pod::Simple::Role::XHTML::WithAccurateTargets;
use Moo::Role;

our $VERSION = '0.004000';
$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.004000';
$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.331 second using v1.01-cache-2.11-cpan-49f99fa48dc )