Pod::Readme(3) User Contributed Perl Documentation Pod::Readme(3)

Pod::Readme - Intelligently generate a README file from POD

In a module's POD:

  =head1 NAME
  MyApp - my nifty app
  =for readme plugin version
  =head1 DESCRIPTION
  This is a nifty app.
  =begin :readme
  =for readme plugin requires
  =head1 INSTALLATION
  ...
  =end :readme
  =for readme stop
  =head1 METHODS
  ...

Then from the command-line:

  pod2readme lib/MyModule.pm README

From within Perl:

  use Pod::Readme;
  my $prf = Pod::Readme->new(
    input_file          => 'lib/MyModule.pm',
    translate_to_file   => $dest,
    translation_class   => 'Pod::Simple::Text',
  );
  $prf->run();

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.

Stop including the POD that follows in the README.

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 file="INSTALL" type="text"

Include a text or POD file in the README. It accepts the following options:

"file"
Required. This is the file name to include.
"type"
Can be "text" or "pod" (default).
"start"
An optional regex of where to start including the file.
"stop"
An optional regex of where to stop including the file.

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

  =begin text
  ...
  =end text

and will only be included in README files of that format.

Note: earlier versions of this module suggested using

  =begin readme
  ...
  =end readme

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.

See "dependencies_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.

Its use is deprecated, and will be deleted in later versions.

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 <rrwo@cpan.org> until 2010, when maintenance was taken over by David Precious <davidp@preshweb.co.uk>.

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.

2018-10-31 perl v5.34.0