File Coverage

blib/lib/Pod/Weaver/Section/CollectWithIntro.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             #
2             # This file is part of Pod-Weaver-Section-CollectWithIntro
3             #
4             # This software is Copyright (c) 2012 by Chris Weyl.
5             #
6             # This is free software, licensed under:
7             #
8             # The GNU Lesser General Public License, Version 2.1, February 1999
9             #
10             package Pod::Weaver::Section::CollectWithIntro;
11             {
12             $Pod::Weaver::Section::CollectWithIntro::VERSION = '0.001';
13             }
14              
15             # ABSTRACT: Preface pod collections
16              
17 1     1   102014 use Moose;
  1         3  
  1         11  
18 1     1   6402 use namespace::autoclean;
  1         3  
  1         13  
19 1     1   1219 use autobox::Core;
  1         8123  
  1         13  
20 1     1   1423 use aliased 'Pod::Elemental::Element::Pod5::Ordinary';
  1         680  
  1         6  
21              
22             extends 'Pod::Weaver::Section::Collect';
23              
24              
25             has content => (is => 'ro', isa => 'Str', required => 1);
26              
27             before weave_section => sub {
28             my ($self, $document, $input) = @_;
29              
30             return unless $self->__used_container;
31              
32             ### make our paragraph node here...
33             my $para = Ordinary->new(
34             content => $self->content,
35             );
36              
37             ### and add to the beginning of the node list..
38             $self->__used_container->children->unshift($para);
39              
40             return;
41             };
42              
43             __PACKAGE__->meta->make_immutable;
44             !!42;
45              
46             __END__
47              
48             =pod
49              
50             =encoding utf-8
51              
52             =for :stopwords Chris Weyl
53              
54             =head1 NAME
55              
56             Pod::Weaver::Section::CollectWithIntro - Preface pod collections
57              
58             =head1 VERSION
59              
60             This document describes version 0.001 of Pod::Weaver::Section::CollectWithIntro - released October 29, 2012 as part of Pod-Weaver-Section-CollectWithIntro.
61              
62             =head1 SYNOPSIS
63              
64             ; weaver.ini
65             [CollectWithIntro / ATTRIBUTES]
66             command = attr
67             content = These attributes are especially tasty in the fall.
68              
69             # in your Perl...
70             =attr blueberries
71              
72             Holds our blueberries.
73              
74             =cut
75              
76             # in the output pod...
77             =head1 ATTRIBUTES
78              
79             These attributes are especially tasty in the fall.
80              
81             =head2 blueberries
82              
83             # ... you get the idea.
84              
85             =head1 DESCRIPTION
86              
87             This is a subclass of L<Pod::Weaver::Section::Collect> that allows one to
88             attach a prefix paragraph to the collected section/node.
89              
90             =head1 ATTRIBUTES
91              
92             =head2 content *required*
93              
94             The intro paragraph. Right now this is expected to be a bog-simple string.
95             Using POD or other bits will probably be supported down the road, but for now,
96             it's just a string.
97              
98             This is wrapped in a L<Pod::Elemental::Element::Pod5::Ordinary> and included
99             after the section header but before any of the elements.
100              
101             =head1 SEE ALSO
102              
103             Please see those modules/websites for more information related to this module.
104              
105             =over 4
106              
107             =item *
108              
109             L<Pod::Weaver::Section::Collect>
110              
111             =back
112              
113             =head1 SOURCE
114              
115             The development version is on github at L<http://github.com/RsrchBoy/Pod-Weaver-Section-CollectWithIntro>
116             and may be cloned from L<git://github.com/RsrchBoy/Pod-Weaver-Section-CollectWithIntro.git>
117              
118             =head1 BUGS
119              
120             Please report any bugs or feature requests on the bugtracker website
121             https://github.com/RsrchBoy/Pod-Weaver-Section-CollectWithIntro/issues
122              
123             When submitting a bug or request, please include a test-file or a
124             patch to an existing test-file that illustrates the bug or desired
125             feature.
126              
127             =head1 AUTHOR
128              
129             Chris Weyl <cweyl@alumni.drew.edu>
130              
131             =head1 COPYRIGHT AND LICENSE
132              
133             This software is Copyright (c) 2012 by Chris Weyl.
134              
135             This is free software, licensed under:
136              
137             The GNU Lesser General Public License, Version 2.1, February 1999
138              
139             =cut