--- trunk/lib/Frey/Pod.pm 2009/02/03 20:55:45 1033 +++ trunk/lib/Frey/Pod.pm 2009/02/03 21:24:02 1034 @@ -21,6 +21,14 @@ use Pod::Find qw/pod_where/; use Data::Dump qw/dump/; +=head2 as_markup + + my $html = $o->as_markup; + + my ( $toc_html, $html ) = $o->as_markup; + +=cut + sub as_markup { my $self = shift; my $class = $self->class; @@ -84,7 +92,9 @@ $toc_html .= qq|
  • $target
  • \n|; } - if ( $toc_html ) { + $toc_html .= qq|| while ( $current_level-- ); + + if ( $toc_html && ! wantarray ) { $self->add_css(qq| .pod-toc { float: right; @@ -115,7 +125,8 @@ } |); - return $toc_html . $body; + return ( $toc_html , $body ) if wantarray; + return $toc_html . $body; }