20 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
21 |
use Pod::Find qw/pod_where/; |
use Pod::Find qw/pod_where/; |
22 |
|
|
23 |
sub markup { |
sub as_markup { |
24 |
my $self = shift; |
my $self = shift; |
25 |
my $class = $self->class; |
my $class = $self->class; |
26 |
use Pod::Simple::HTML; |
use Pod::Simple::HTML; |
27 |
my $path = pod_where( { -inc => 1 }, $class ); |
my $path = pod_where( { -inc => 1 }, $class ); |
28 |
return $self->error( "Can't find pod for $class" ) unless $path; |
return $self->error( "Can't find pod for $class\n" ) unless $path; |
29 |
my $pod = read_file( $path ); |
my $pod = read_file( $path ); |
30 |
my $converter = Pod::Simple::HTML->new(); |
my $converter = Pod::Simple::HTML->new(); |
31 |
my $body; |
my $body; |
41 |
$body =~ s!</ul>!</ul></li>!; |
$body =~ s!</ul>!</ul></li>!; |
42 |
$body =~ s!<p></p>!!; |
$body =~ s!<p></p>!!; |
43 |
$body =~ s!__index__!index!g; |
$body =~ s!__index__!index!g; |
44 |
return $body unless wantarray; |
$self->title( $class ); |
45 |
return { |
return $body; |
|
title => $class, |
|
|
body => $body, |
|
|
}; |
|
46 |
|
|
47 |
} |
} |
48 |
|
|