| 1 | package PPI::Transform::Doxygen::POD; | ||
| 2 | |||
| 3 | 2 | ▶ | use 5.010001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 2 | ▶ | use parent qw(Pod::POM::View::HTML); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 2 | our $VERSION = '0.1'; | |
| 9 | |||
| 10 | 2 | our $PREFIX = ''; | |
| 11 | |||
| 12 | sub view_pod { | ||
| 13 | 18 | ▶ | my ($self, $pod) = @_; |
|
Subroutine
view_pod: called CC=1 SCAR=0.0
Pod
documented
| |||
| 14 | 18 | return $pod->content->present($self); | |
| 15 | } | ||
| 16 | |||
| 17 | sub view_head1 { | ||
| 18 | 3 | ▶ | my ($self, $head1) = @_; |
|
Subroutine
view_head1: called CC=1 SCAR=0.0
Pod
documented
| |||
| 19 | 3 | my $title = $head1->title->present($self); | |
| 20 | 3 | my $name = $title; | |
| 21 | 3 | $name =~ s/\s/_/g; | |
| 22 | 3 | return "\n\@section ${PREFIX}_$name $title\n" . $head1->content->present($self); | |
| 23 | } | ||
| 24 | |||
| 25 | sub view_head2 { | ||
| 26 | 1 | ▶ | my ($self, $head2) = @_; |
|
Subroutine
view_head2: called CC=1 SCAR=0.0
Pod
documented
| |||
| 27 | 1 | my $title = $head2->title->present($self); | |
| 28 | 1 | my $name = $title; | |
| 29 | 1 | $name =~ s/\s/_/g; | |
| 30 | 1 | return "\n\@subsection $name $title\n" . $head2->content->present($self); | |
| 31 | } | ||
| 32 | |||
| 33 | sub view_seq_code { | ||
| 34 | 1 | ▶ | my ($self, $text) = @_; |
|
Subroutine
view_seq_code: called CC=1 SCAR=0.0
Pod
documented
| |||
| 35 | 1 | _unquote($text); | |
| 36 | 1 | return "\n\@code\n$text\n\@endcode\n"; | |
| 37 | } | ||
| 38 | |||
| 39 | sub view_verbatim { | ||
| 40 | 1 | ▶ | my ($self, $text) = @_; |
|
Subroutine
view_verbatim: called CC=1 SCAR=0.0
Pod
documented
| |||
| 41 | 1 | _unquote($text); | |
| 42 | 1 | return "\n\@code\n$text\n\@endcode\n"; | |
| 43 | } | ||
| 44 | |||
| 45 | 2 | my %HTML = ( '&' => '&', '<' => '<', '>' => '>'); | |
| 46 | sub _unquote { | ||
| 47 | 2 | ▶ | $_[0] =~ s!\Q$_!$HTML{$_}!g for keys %HTML; |
|
Subroutine
_unquote: called CC=2 SCAR=6.9
| |||
| 48 | 2 | $_[0] =~ s!\\(\@|\\|\%|#)!$1!g; | |
| 49 | } | ||
| 50 | |||
| 51 | |||
| 52 | 2 | 1; | |
| 53 | |||
| 54 | __END__ | ||