7 |
|
|
8 |
=cut |
=cut |
9 |
|
|
10 |
extends 'Frey::ClassLoader'; |
extends 'Frey::Class::Loader'; |
11 |
with 'Frey::Web'; |
with 'Frey::Web'; |
12 |
with 'Frey::File'; |
with 'Frey::File'; |
13 |
|
|
48 |
sub heading { |
sub heading { |
49 |
my ($level,$html) = @_; |
my ($level,$html) = @_; |
50 |
push @toc, { $level => $html }; |
push @toc, { $level => $html }; |
51 |
warn "# heading $level $html"; |
warn "## heading $level $html" if $self->debug; |
52 |
qq|<$level>$html</$level>|; |
qq|<$level>$html</$level>|; |
53 |
} |
} |
54 |
$body =~ s{<(h\d+)>(.+?)</\1>}{heading($1,$2)}egs; |
$body =~ s{<(h\d+)>(.+?)</\1>}{heading($1,$2)}egs; |
101 |
.pod-toc a { |
.pod-toc a { |
102 |
text-decoration: none; |
text-decoration: none; |
103 |
} |
} |
104 |
|
|
105 |
|); |
|); |
106 |
$toc_html = qq|<div class="pod-toc">$toc_html</div>|; |
$toc_html = qq|<div class="pod-toc">$toc_html</div>|; |
107 |
} |
} |
108 |
|
|
109 |
|
$self->add_css(qq| |
110 |
|
pre { |
111 |
|
color: #444; |
112 |
|
border: 1px solid #eee; |
113 |
|
padding-top: 0.5em; |
114 |
|
padding-bottom: 0.5em; |
115 |
|
} |
116 |
|
|); |
117 |
|
|
118 |
return $toc_html . $body; |
return $toc_html . $body; |
119 |
|
|
120 |
} |
} |