| 1 | package Pod::Elemental::Element::Nested 0.103006; | ||
| 2 | # ABSTRACT: an element that is a command and a node | ||
| 3 | |||
| 4 | 3 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 3 | extends 'Pod::Elemental::Element::Generic::Command'; | |
| 6 | 3 | with 'Pod::Elemental::Node'; | |
| 7 | 3 | with 'Pod::Elemental::Autochomp'; | |
| 8 | |||
| 9 | 3 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | # BEGIN Autochomp Replacement | ||
| 12 | 3 | ▶ | use Pod::Elemental::Types qw(ChompedString); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 3 | has '+content' => (coerce => 1, isa => ChompedString); | |
| 14 | # END Autochomp Replacement | ||
| 15 | |||
| 16 | #pod =head1 WARNING | ||
| 17 | #pod | ||
| 18 | #pod This class is somewhat sketchy and may be refactored somewhat in the future, | ||
| 19 | #pod specifically to refactor its similarities to | ||
| 20 | #pod L<Pod::Elemental::Element::Pod5::Region>. | ||
| 21 | #pod | ||
| 22 | #pod =head1 OVERVIEW | ||
| 23 | #pod | ||
| 24 | #pod A Nested element is a Generic::Command element that is also a node. | ||
| 25 | #pod | ||
| 26 | #pod It's used by the nester transformer to produce commands with children, to make | ||
| 27 | #pod documents seem more structured for easy manipulation. | ||
| 28 | #pod | ||
| 29 | #pod =cut | ||
| 30 | |||
| 31 | 3 | ▶ | override as_pod_string => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 32 | 3 | my ($self) = @_; | |
| 33 | |||
| 34 | 3 | my $string = super; | |
| 35 | |||
| 36 | $string = join q{}, | ||
| 37 | "$string\n\n", | ||
| 38 | 3 | map { $_->as_pod_string } @{ $self->children }; | |
| 39 | |||
| 40 | 3 | $string =~ s/\n{3,}\z/\n\n/g; | |
| 41 | |||
| 42 | 3 | return $string; | |
| 43 | 3 | }; | |
| 44 | |||
| 45 | 3 | __PACKAGE__->meta->make_immutable; | |
| 46 | |||
| 47 | 3 | 1; | |
| 48 | |||
| 49 | __END__ | ||