21 |
use Pod::Find qw/pod_where/; |
use Pod::Find qw/pod_where/; |
22 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
23 |
|
|
24 |
|
=head2 as_markup |
25 |
|
|
26 |
|
my $html = $o->as_markup; |
27 |
|
|
28 |
|
my ( $toc_html, $html ) = $o->as_markup; |
29 |
|
|
30 |
|
=cut |
31 |
|
|
32 |
sub as_markup { |
sub as_markup { |
33 |
my $self = shift; |
my $self = shift; |
34 |
my $class = $self->class; |
my $class = $self->class; |
92 |
$toc_html .= qq|<li title="$level">$target</li>\n|; |
$toc_html .= qq|<li title="$level">$target</li>\n|; |
93 |
} |
} |
94 |
|
|
95 |
if ( $toc_html ) { |
$toc_html .= qq|</ul>| while ( $current_level-- ); |
96 |
|
|
97 |
|
if ( $toc_html && ! wantarray ) { |
98 |
$self->add_css(qq| |
$self->add_css(qq| |
99 |
.pod-toc { |
.pod-toc { |
100 |
float: right; |
float: right; |
125 |
} |
} |
126 |
|); |
|); |
127 |
|
|
128 |
return $toc_html . $body; |
return ( $toc_html , $body ) if wantarray; |
129 |
|
return $toc_html . $body; |
130 |
|
|
131 |
} |
} |
132 |
|
|