… | |
… | |
193 | Coro::Storable::freeze pom_as_paragraphs +(Pod::POM->new->parse_text ($pod)) |
193 | Coro::Storable::freeze pom_as_paragraphs +(Pod::POM->new->parse_text ($pod)) |
194 | } |
194 | } |
195 | }; |
195 | }; |
196 | } |
196 | } |
197 | |
197 | |
198 | # format as gcfclient-style text |
198 | # format as cfpod-style text |
199 | sub as_text($) { |
199 | sub as_text($) { |
200 | my ($pars) = @_; |
200 | my ($pars) = @_; |
201 | |
201 | |
202 | my $res; |
202 | my $res; |
203 | |
203 | |
204 | for my $par (@$pars) { |
204 | for my $par (@$pars) { |
205 | if ($par->{type} =~ /^head\d+$/) { |
205 | if ($par->{type} =~ /^head\d+$/) { |
206 | $res .= "$par->{markup}\n\n"; |
206 | $res .= "B<$par->{markup}>\n\n"; |
207 | } elsif ($par->{type} eq "verbatim") { |
207 | } elsif ($par->{type} eq "verbatim") { |
208 | $res .= "\n$par->{markup}\n\n"; |
208 | $res .= "\n$par->{markup}\n\n"; |
209 | } elsif ($par->{type} eq "item") { |
209 | } elsif ($par->{type} eq "item") { |
210 | $res .= "\n* $par->{markup}\n\n"; |
210 | $res .= "\n* I<$par->{markup}>\n\n"; |
211 | } else { |
211 | } else { |
212 | $res .= "$par->{markup}\n"; |
212 | $res .= "$par->{markup}\n\n"; |
213 | } |
213 | } |
214 | } |
214 | } |
215 | |
215 | |
216 | $res =~ s/\n\n+/\n/g; |
|
|
217 | |
|
|
218 | $res =~ s/<(\/?[\S+])>/[$1]/g; |
|
|
219 | $res =~ s/</</g; |
|
|
220 | $res =~ s/>/>/g; |
|
|
221 | $res =~ s/&/&/g; |
|
|
222 | |
|
|
223 | $res |
216 | $res |
224 | } |
217 | } |
225 | |
218 | |
226 | 1; |
219 | 1; |
227 | |
220 | |