Pod::Weaver::Plugin::Eval - (DEPRECATED) Evaluate code
This document describes version 0.03 of Pod::Weaver::Plugin::Eval (from Perl distribution Pod-Weaver-Plugin-Eval), released on 2016-10-14.
In your weaver.ini:
[-Eval] include_modules = ^Foo::Bar$ ;include_files = REGEX code = sub { my ($self, %args)=@_; use Module::Load; load $args{module}; my $document = $args{document}; push @{$document->children}, ... }
DEPRECATION NOTICE: This module is deprecated in favor of Pod::Weaver::Plugin::Run.
This plugin evaluates Perl code specified in your weaver.ini (or dist.ini). It can be used to do various stuffs that might be too trivial/short to build a dedicated Pod::Weaver::Plugin for.
I first created this module to insert list of border styles and color themes contained in %border_styles package variable in Text::ANSITable::BorderStyle::* modules and %color_themes variable in Text::ANSITable::ColorTheme::* modules.
%border_styles
Text::ANSITable::BorderStyle::*
%color_themes
Text::ANSITable::ColorTheme::*
Yes, it's a dirty (and ugly) hack. But it's quick :-)
Value should be a regex, e.g. /Foo/Bar/.
/Foo/Bar/
Value should be a regex, e.g. ^Foo::Bar$.
^Foo::Bar$
Should be something like:
sub { my ($self, %args) = @_; ... }
sub { and } will be added if code does not have it. Code will be called with %args containing these keys:
sub {
}
%args
filename => STR
package => STR
module => STR
Alias for package.
package
args => ARRAY
The original @_ passed to weave_section(). Note that weave_section() is passed:
@_
($self, $document, $input)
document => OBJ
Document object passed to weave_section(). This is the output POD we are building and this is what we're mostly interested in, usually. It can also be retrieved from args.
args
input => OBJ
The input object passed to weave_section(). It contains information about the input (original) document. Can also be retrieved from args.
Please visit the project's homepage at https://metacpan.org/release/Pod-Weaver-Plugin-Eval.
Source repository is at https://github.com/sharyanto/perl-Pod-Weaver-Plugin-Eval.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Pod-Weaver-Plugin-Eval
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Pod::Weaver
Pod::Weaver::Plugin::Run
perlancar <perlancar@cpan.org>
This software is copyright (c) 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Pod::Weaver::Plugin::Eval, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pod::Weaver::Plugin::Eval
CPAN shell
perl -MCPAN -e shell install Pod::Weaver::Plugin::Eval
For more information on module installation, please visit the detailed CPAN module installation guide.