SYNOPSIS

  use Pod::Readme;
  my $parser = Pod::Readme->new();

  # Read POD from STDIN and write to STDOUT
  $parser->parse_from_filehandle;

  # Read POD from Module.pm and write to README
  $parser->parse_from_file('Module.pm', 'README');

DESCRIPTION

This module is a subclass of Pod::PlainText which provides additional \s-1POD\s0 markup for generating \s-1README\s0 files.

Why should one bother with this? One can simply use

pod2text Module.pm > README

A problem with doing that is that the default pod2text converter will add text to links, so that \*(L"L<Module>\*(R" is translated to \*(L"the Module manpage\*(R".

Another problem is that the \s-1README\s0 includes the entirety of the module documentation! Most people browsing the \s-1README\s0 file do not need all of this information.

Likewise, including installation and requirement information in the module documentation is not necessary either, since the module is already installed.

This module allows authors to mark portions of the \s-1POD\s0 to be included only in, or to be excluded from the \s-1README\s0 file. It also allows you to include portions of another file (such as a separate ChangeLog).

Markup

Special \s-1POD\s0 markup options are described below:

begin/end

=begin readme

=head1 README ONLY

This section will only show up in the README file.

=end readme Delineates a \s-1POD\s0 section that is only available in \s-1README\s0 file. If you prefer to include plain text instead, add the \*(C`text\*(C' modifier: =begin readme text

README ONLY (PLAINTEXT)

This section will only show up in the README file.

=end readme Note that placing a colon before the section to indicate that it is \s-1POD\s0 (e.g. \*(C`begin :readme\*(C') is not supported in this version.

stop/continue

=for readme stop All \s-1POD\s0 that follows will not be included in the \s-1README\s0, until a \*(C`continue\*(C' command occurs: =for readme continue

include

=for readme include file=filename type=type start=Regexp stop=Regexp

=for readme include file=Changes start=^0.09 stop=^0.081 type=text Includes a plaintext file named filename, starting with the line that contains the start \*(C`Regexp\*(C' and ending at the line that begins with the stop \*(C`Regexp\*(C'. (The start and stop Regexps are optional: one or both may be omitted.) Type may be \*(C`text\*(C' or \*(C`pod\*(C'. If omitted, \*(C`pod\*(C' will be assumed. Quotes may be used when the filename or marks contains spaces: =for readme include file="another file.pod"

One can also using maintain multiple file types (such as including \s-1TODO\s0, or \s-1COPYING\s0) by using a modified constructor:

$parser = Pod::Readme->new( readme_type => "copying" );

In the above \*(L"Markup\*(R" commands replace \*(L"readme\*(R" with the tag specified instead (such as \*(L"copying\*(R"):

=begin copying

As of version 0.03 you can specify multiple sections by separating them with a comma:

=begin copying,readme

There is also no standard list of type names. Some names might be recognized by other \s-1POD\s0 processors (such as \*(L"testing\*(R" or \*(L"html\*(R"). Pod::Readme will reject the following \*(L"known\*(R" type names when they are specified in the constructor:

testing html xhtml xml docbook rtf man nroff dsr rno latex tex code

You can also use a \*(L"debug\*(R" mode to diagnose any problems, such as mistyped format names:

$parser = Pod::Readme->new( debug => 1 );

Warnings will be issued for any ignored formatting commands.

Example

For an example, see the Readme.pm file in this distribution.

RELATED TO Pod::Readme…

See perlpod, perlpodspec and podlators.

AUTHOR

Originally by Robert Rothenberg <rrwo at cpan.org>

Now maintained by David Precious <[email protected]>

Suggestions, Bug Reporting and Contributing

This module is developed on GitHub at:

http://github.com/bigpresh/Pod-Readme

LICENSE

Copyright (c) 2005,2006 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.

Some portions are based on Pod::PlainText 2.02.