]> Dogcows Code - chaz/p5-Dist-Zilla-PluginBundle-Author-CCM/blob - lib/Pod/Weaver/PluginBundle/Author/CCM.pm
Version 0.001
[chaz/p5-Dist-Zilla-PluginBundle-Author-CCM] / lib / Pod / Weaver / PluginBundle / Author / CCM.pm
1 package Pod::Weaver::PluginBundle::Author::CCM;
2 # ABSTRACT: A plugin bundle for pod woven by CCM
3
4
5 use warnings;
6 use strict;
7
8 our $VERSION = '0.001'; # VERSION
9
10 use Pod::Weaver::Config::Assembler;
11 use namespace::autoclean;
12
13
14 sub configure {
15 return (
16 ['-EnsurePod5'],
17 ['-H1Nester'],
18 ['-SingleEncoding'],
19
20 ['-Transformer' => List => {transformer => 'List'}],
21 ['-Transformer' => Verbatim => {transformer => 'Verbatim'}],
22
23 ['Region' => 'header'],
24
25 'Name',
26 # ['Badges' => {badge => [qw(perl travis coverage)], formats => 'html, markdown'}],
27
28 'Version',
29
30 ['Region' => 'prelude'],
31
32 ['Generic' => 'SYNOPSIS'],
33 ['Generic' => 'DESCRIPTION'],
34 ['Generic' => 'OVERVIEW'],
35 ['Collect' => 'ATTRIBUTES' => {command => 'attr'}],
36 ['Collect' => 'METHODS' => {command => 'method'}],
37 ['Collect' => 'FUNCTIONS' => {command => 'func'}],
38
39 'Leftovers',
40
41 ['Region' => 'postlude'],
42
43 'Bugs',
44 'Authors',
45 'Contributors',
46 'Legal',
47
48 ['Region' => 'footer'],
49 );
50 }
51
52
53 sub mvp_bundle_config {
54 my $self = shift || __PACKAGE__;
55
56 return map { $self->_expand_config($_) } $self->configure;
57 }
58
59 sub _exp { Pod::Weaver::Config::Assembler->expand_package($_[0]) }
60
61 sub _expand_config {
62 my $self = shift;
63 my $spec = shift;
64
65 my ($name, $package, $payload);
66
67 if (!ref $spec) {
68 ($name, $package, $payload) = ($spec, $spec, {});
69 }
70 elsif (@$spec == 1) {
71 ($name, $package, $payload) = (@$spec[0,0], {});
72 }
73 elsif (@$spec == 2) {
74 ($name, $package, $payload) = ref $spec->[1] ? @$spec[0,0,1] : (@$spec[1,0], {});
75 }
76 else {
77 ($package, $name, $payload) = @$spec;
78 }
79
80 $name =~ s/^[@=-]//;
81 $package = _exp($package);
82
83 if ($package eq _exp('Region')) {
84 $name = $spec->[1];
85 $payload = {region_name => $spec->[1], %$payload};
86 }
87
88 $name = '@Author::CCM/' . $name if $package ne _exp('Generic') && $package ne _exp('Collect');
89
90 return [$name => $package => $payload];
91 }
92
93 1;
94
95 __END__
96
97 =pod
98
99 =encoding UTF-8
100
101 =head1 NAME
102
103 Pod::Weaver::PluginBundle::Author::CCM - A plugin bundle for pod woven by CCM
104
105 =head1 VERSION
106
107 version 0.001
108
109 =head1 SYNOPSIS
110
111 # In your weaver.ini file:
112 [@Author::CCM]
113
114 # In your dist.ini file:
115 [PodWeaver]
116 config_plugin = @Author::CCM
117
118 =head1 DESCRIPTION
119
120 You probably don't want to use this.
121
122 =head1 METHODS
123
124 =head2 configure
125
126 Returns the configuration in a form similar to what one might use with
127 L<Dist::Zilla::Role::PluginBundle::Easy/add_plugins>.
128
129 =head2 mvp_bundle_config
130
131 Required in order to be a plugin bundle.
132
133 =head1 SEE ALSO
134
135 =over 4
136
137 =item *
138
139 L<Pod::Weaver>
140
141 =item *
142
143 L<Pod::Weaver::PluginBundle::Author::ETHER>
144
145 =back
146
147 =head1 CREDITS
148
149 This module was heavily inspired by Karen Etheridge's config.
150
151 =head1 BUGS
152
153 Please report any bugs or feature requests on the bugtracker website
154 L<https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM/issues>
155
156 When submitting a bug or request, please include a test-file or a
157 patch to an existing test-file that illustrates the bug or desired
158 feature.
159
160 =head1 AUTHOR
161
162 Charles McGarvey <chazmcgarvey@brokenzipper.com>
163
164 =head1 COPYRIGHT AND LICENSE
165
166 This software is copyright (c) 2016 by Charles McGarvey.
167
168 This is free software; you can redistribute it and/or modify it under
169 the same terms as the Perl 5 programming language system itself.
170
171 =cut
This page took 0.041166 seconds and 4 git commands to generate.