File Coverage

blib/lib/Perl6/Pod/Block/nested.pm
Criterion Covered Total %
statement 18 26 69.2
branch n/a
condition n/a
subroutine 6 8 75.0
pod 2 2 100.0
total 26 36 72.2


line stmt bran cond sub pod time code
1             package Perl6::Pod::Block::nested;
2              
3             =pod
4              
5             =head1 NAME
6              
7             Perl6::Pod::Block::nested - Nesting blocks
8              
9             =head1 SYNOPSIS
10              
11             =begin nested
12             We are all of us in the gutter,E
13             but some of us are looking at the stars!
14             =begin nested
15             -- Oscar Wilde
16             =end nested
17             =end nested
18              
19             =head1 DESCRIPTION
20              
21             Any block can be nested by specifying a C<:nested> option on it:
22              
23             =begin para :nested
24             We are all of us in the gutter,E
25             but some of us are looking at the stars!
26             =end para
27              
28             However, qualifying each nested paragraph individually quickly becomes
29             tedious if there are many in a sequence, or if multiple levels of
30             nesting are required:
31              
32             =begin para
33             We are all of us in the gutter,E
34             but some of us are looking at the stars!
35             =end para
36             =begin para :nested(2)
37             -- Oscar Wilde
38             =end para
39              
40             So Pod provides a C<=nested> block that marks all its contents as being
41             nested:
42              
43             =begin nested
44             We are all of us in the gutter,E
45             but some of us are looking at the stars!
46             =begin nested
47             -- Oscar Wilde
48             =end nested
49             =end nested
50              
51             Nesting blocks can contain any other kind of block, including implicit
52             paragraph and code blocks. Note that the relative physical indentation
53             of the blocks plays no role in determining their ultimate nesting.
54             The preceding example could equally have been specified:
55              
56             =begin nested
57             We are all of us in the gutter,E
58             but some of us are looking at the stars!
59             =begin nested
60             -- Oscar Wilde
61             =end nested
62             =end nested
63              
64             =head1 FORMATS
65              
66             =cut
67              
68 3     3   14 use warnings;
  3         5  
  3         80  
69 3     3   14 use strict;
  3         4  
  3         59  
70 3     3   14 use Data::Dumper;
  3         6  
  3         131  
71 3     3   15 use Test::More;
  3         5  
  3         29  
72 3     3   970 use Perl6::Pod::Block;
  3         6  
  3         66  
73 3     3   15 use base 'Perl6::Pod::Block';
  3         5  
  3         552  
74             our $VERSION = '0.01';
75              
76             =head2 to_xhtml
77              
78             =nested
79             test code
80              
81             Render to:
82              
83            
84             test code
85            
86             =cut
87              
88             sub to_xhtml {
89 0     0 1   my ( $self, $to ) = @_;
90 0           $to->w->start_nesting();
91 0           $to->visit_childs($self);
92 0           $to->w->stop_nesting();
93             }
94              
95             =head2 to_docbook
96              
97             =nested
98             test code
99              
100             Render to:
101              
102            
103             test code
104            
105             =cut
106              
107             sub to_docbook {
108 0     0 1   my ( $self, $to ) = @_;
109 0           $to->w->start_nesting();
110 0           $to->visit_childs($self);
111 0           $to->w->stop_nesting();
112             }
113             1;
114             __END__