04 Oct 2021 17:43:55 UTC
- Distribution: Dist-Zilla-Plugin-InsertExample
- Module version: 0.15
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Testers (169 / 0 / 0)
- KwaliteeBus factor: 1
- 91.85% Coverage
- License: perl_5
- Perl: v5.20.0
- Activity24 month
- Download (18.6KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- COPYRIGHT AND LICENSE
Dist::Zilla::Plugin::InsertExample - Insert example into your POD from a file
In your dist.ini:
In your POD:
=head1 EXAMPLE Here is an exaple that writes hello world to the terminal: # EXAMPLE: example/hello.pl
File in your dist named example/hello.pl
#!/usr/bin/perl say 'hello world';
After dzil build your POD becomes:
=head1 EXAMPLE Here is an example that writes hello world to the terminal: #!/usr/bin/perl say 'hello world';
and example/hello.pl is there too (unless you prune it with another plugin).
This plugin takes examples included in your distribution and inserts them in your POD where you have an EXAMPLE directive. This allows you to keep a version in the distribution which can be run by you and your users, as well as making it available in your POD documentation, without the need for updating example scripts in multiple places.
When the example is inserted into your pod a space will be appended at the start of each line so that it is printed in a fixed width font.
This plugin will first look for examples in the currently building distribution, including generated and munged files. If no matching filename is found, it will look in the distribution source root.
use warnings;from the beginning of your example before inserting them into the POD.
A regular expression matching a line indicating the end of boilerplate. This option may be used multiple times. It must be used in conjunction with "remove_boiler".
Specifies the number of spaces to indent by. This is 1 by default, because it is sufficient to force POD to consider it a verbatim paragraph. I understand a lot of Perl programmers out there prefer 4 spaces. You can also set this to 0 to get no indentation at all and it won't be a verbatim paragraph at all.
Author: Graham Ollis <email@example.com>
Diab Jerius (DJERIUS)
This software is copyright (c) 2013 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Dist::Zilla::Plugin::InsertExample, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Dist::Zilla::Plugin::InsertExample
For more information on module installation, please visit the detailed CPAN module installation guide.