1 package Module::Install::ReadmeFromPod;
5 use base qw(Module::Install::Base);
12 return unless $Module::Install::AUTHOR;
13 my $file = shift || return;
16 my $parser = Pod::Text->new();
17 open README, '> README' or die "$!\n";
18 $parser->output_fh( *README );
19 $parser->parse_file( $file );
20 return 1 unless $clean;
21 $self->postamble(<<"END");
22 distclean :: license_clean
36 Module::Install::ReadmeFromPod - A Module::Install extension to automatically convert POD to a README
42 use inc::Module::Install;
43 author 'Vestan Pants';
45 readme_from 'lib/Some/Module.pm';
47 A C<README> file will be generated from the POD of the indicated module file.
51 Module::Install::ReadmeFromPod is a L<Module::Install> extension that generates a C<README> file
52 automatically from an indicated file containing POD, whenever the author runs C<Makefile.PL>.
56 This plugin adds the following Module::Install command:
62 Does nothing on the user-side. On the author-side it will generate a C<README> file using L<Pod::Text> from
63 the POD in the file passed as a parameter.
65 readme_from 'lib/Some/Module.pm';
67 If a second parameter is set to a true value then the C<README> will be removed at C<make distclean>.
69 readme_from 'lib/Some/Module.pm' => 'clean';
75 Chris C<BinGOs> Williams
79 Copyright E<copy> Chris Williams
81 This module may be used, modified, and distributed under the same terms as Perl itself. Please see the license that came with your Perl distribution for details.