Pod::Readme(3pm)
β¨ NAME β¨
Pod::Readme β the module that intelligently generates a README file from POD π
(yes bestie, the manual page you're reading right now is Pod::Readme(3pm), and it's iconic).
π¦ SYNOPSIS π¦
Okay so first, inside a module's POD you drop stuff like this:
=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, slay:
pod2readme lib/MyModule.pm README
And from within Perl, lowkey the same energy:
use Pod::Readme;
my $prf = Pod::Readme->new(
input_file => 'lib/MyModule.pm',
translate_to_file => $dest,
translation_class => 'Pod::Simple::Text',
);
$prf->run();
πΈ DESCRIPTION πΈ
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. That's it, that's the whole vibe β you tell it what to keep, it keeps it. β¨
π POD COMMANDS π
π "=for readme stop"
Stop including the POD that follows in the README. Like closing the door on your group chat, respectfully. πͺ
π "=for readme start" / "=for readme continue"
Start (or continue to) include the POD that follows in the README.
Note that thestartcommand was added as a synonym in version1.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:
fileβ Required. This is the file name to include. (no file, no entry, periodt)typeβ Can betextorpod(default). πstartβ An optional regex of where to start including the file.stopβ 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. iykyk π
Note that theplugincommand was added in version1.0.0.
π "=begin :readme" / "=end :readme"
Specify a block of POD to include only in the README. Secret little README-only pocket dimension. π
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. π« (works, but it's not the real thing, bestie)
π ATTRIBUTES π
This module extends Pod::Readme::Filter with the following attributes:
π¦ "translation_class"
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. No random classes, sorry babe. π
π¦ "translate_to_fh"
The IO::Handle to save the translated file to.
π¦ "translate_to_file"
The Path::Tiny filename to save the translated file to. If omitted, then it will be saved to STDOUT. β¨
π¦ "output_file"
The Pod::Readme::Filter output_file will default to a temporary file.
π¦ "force"
For a new README to be generated, even if the dependencies have not been updated.
See "dependencies_updated". π
π¦ "zilla"
For use with Dist::Zilla plugins.
This allows plugins which normally depend on files in the distribution to use metadata from here instead.
π§ METHODS π§
This module extends Pod::Readme::Filter with the following methods:
π "default_readme_file"
The default name of the README file, which depends on the translation_class.
π "translate_file"
This method runs translates the resulting POD from filter_file.
π "dependencies_updated"
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.
π "run"
This method runs filter_file and then translate_file. The whole pipeline, the main character moment. π
π "parse_from_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, don't build on it, fr fr. π
π "parse_from_filehandle"
Like parse_from_file, this exists as a compatibility shim.
Its use is deprecated, and will be deleted in later versions. Same warning, same energy. π«Ά
β οΈ CAVEATS β οΈ
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. Do not run this on sketchy code, bestie, I am begging. π
π₯ SEE ALSO π₯
See perlpod, perlpodspec and podlators.
π AUTHORS π
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. Glow-up era. β¨
πΈ Acknowledgements
Thanks to people who gave feedback and suggestions to posts about the rewrite of this module on <http://blogs.perl.org>. Real ones. π«Ά
πΈ Suggestions, Bug Reporting and Contributing
This module is developed on GitHub at <http://github.com/bigpresh/Pod-Readme> β come through! π
π LICENSE π
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.
And that's the whole page, bestie π β this was Pod::Readme for perl v5.28.0, dated 2018-11-26. Go forth and generate READMEs, no cap. π
β¨π
π¦ where this page comes from
- debian bookworm: libpod-readme-perl 1.2.3-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libpod-readme-perl 1.2.3-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libpod-readme-perl 1.2.3-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libpod-readme-perl 1.2.3-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms