8 |
=cut |
=cut |
9 |
|
|
10 |
extends 'Frey::Class::Loader'; |
extends 'Frey::Class::Loader'; |
11 |
with 'Frey::Web'; |
with 'Frey::Web', 'Frey::File'; |
|
with 'Frey::File'; |
|
12 |
|
|
13 |
has 'class' => ( |
has 'class' => ( |
14 |
is => 'rw', |
is => 'rw', |
20 |
use Pod::Find qw/pod_where/; |
use Pod::Find qw/pod_where/; |
21 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
22 |
|
|
23 |
|
=head2 as_markup |
24 |
|
|
25 |
|
my $html = $o->as_markup; |
26 |
|
|
27 |
|
my ( $toc_html, $html ) = $o->as_markup; |
28 |
|
|
29 |
|
=cut |
30 |
|
|
31 |
sub as_markup { |
sub as_markup { |
32 |
my $self = shift; |
my $self = shift; |
33 |
my $class = $self->class; |
my $class = $self->class; |
91 |
$toc_html .= qq|<li title="$level">$target</li>\n|; |
$toc_html .= qq|<li title="$level">$target</li>\n|; |
92 |
} |
} |
93 |
|
|
94 |
if ( $toc_html ) { |
$toc_html .= qq|</ul>| while ( $current_level-- ); |
95 |
|
|
96 |
|
if ( $toc_html && ! wantarray ) { |
97 |
$self->add_css(qq| |
$self->add_css(qq| |
98 |
.pod-toc { |
.pod-toc { |
99 |
float: right; |
float: right; |
124 |
} |
} |
125 |
|); |
|); |
126 |
|
|
127 |
return $toc_html . $body; |
return ( $toc_html , $body ) if wantarray; |
128 |
|
return $toc_html . $body; |
129 |
|
|
130 |
} |
} |
131 |
|
|
132 |
1; |
__PACKAGE__->meta->make_immutable; |
133 |
|
no Moose; |
134 |
|
|
135 |
|
1; |