Pod::Readme - Intelligently generate a README file from POD
In a module's POD:
MyApp - my nifty app
=for readme plugin version
This is a nifty app.
=for readme plugin requires
=for readme stop
Then from the command-line:
pod2readme lib/MyModule.pm README
From within Perl:
my $prf = Pod::Readme->new(
input_file => 'lib/MyModule.pm',
translate_to_file => $dest,
translation_class => 'Pod::Simple::Text',
This module filters POD to generate a README file, by using POD commands to specify which parts are included or excluded from the README file.
=for readme stop
Stop including the POD that follows in the README.
=for readme start
=for readme continue
Start (or continue to) include the POD that follows in the README.
Note that the start command was added as a synonym in version 1.0.0.
=for readme include
=for readme include file="INSTALL" type="text"
Include a text or POD file in the README. It accepts the following options:
Required. This is the file name to include.
Can be "text" or "pod" (default).
An optional regex of where to start including the file.
An optional regex of where to stop including the file.
=for readme plugin
Loads a plugin, e.g.
=for readme plugin version
Note that specific plugins may add options, e.g.
=for readme plugin changes title='CHANGES'
See Pod::Readme::Plugin for more information.
Note that the plugin command was added in version 1.0.0.
Specify a block of POD to include only in the README.
You can also specify a block in another format:
=begin readme text
=end readme text
This will be translated into
and will only be included in README files of that format.
Note: earlier versions of this module suggested using
While this version supports that syntax for backwards compatibility, it is not standard POD.
This module extends Pod::Readme::Filter with the following attributes:
The class used to translate the filtered POD into another format, e.g. Pod::Simple::Text.
If it is undef, then there is no translation.
Only subclasses of Pod::Simple are supported.
The IO::Handle to save the translated file to.
The Path::Tiny filename to save the translated file to. If omitted, then it will be saved to STDOUT.
The Pod::Readme::Filter output_file will default to a temporary file.
For a new README to be generated, even if the dependencies have not been updated.
For use with Dist::Zilla plugins.
This allows plugins which normally depend on files in the distribution to use metadata from here instead.
This module extends Pod::Readme::Filter with the following methods:
The default name of the README file, which depends on the "translation_class".
This method runs translates the resulting POD from filter_file.
Used to determine when the dependencies have been updated, and a translation can be run.
Note that this only returns a meaningful value after the POD has been processed, since plugins may add to the dependencies. A side-effect of this is that when generating a POD formatted README is that it will always be updated, even when "force" is false.
This method runs filter_file and then "translate_file".
my $parser = Pod::Readme->new();
$parser->parse_from_file( 'README.pod', 'README' );
Pod::Readme->parse_from_file( 'README.pod', 'README' );
This is a class method that acts as a Pod::Select compatibility shim for software that is designed for versions of Pod::Readme prior to v1.0.
Its use is deprecated, and will be deleted in later versions.
Like "parse_from_file", this exists as a compatibility shim.
This module is intended to be used by module authors for their own modules. It is not recommended for generating README files from arbitrary Perl modules from untrusted sources.
See perlpod, perlpodspec and podlators.
The original version was by Robert Rothenberg <firstname.lastname@example.org> until 2010, when maintenance was taken over by David Precious <email@example.com>.
In 2014, Robert Rothenberg rewrote the module to use filtering instead of subclassing a POD parser.
Thanks to people who gave feedback and suggestions to posts about the rewrite of this module on http://blogs.perl.org.
This module is developed on GitHub at http://github.com/bigpresh/Pod-Readme
Copyright (c) 2005-2014 Robert Rothenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Pod::Readme, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.