Pandoc::Filter::Lazy - facilitate creation of filters (deprecated)
my $filter = Pandoc::Filter::Lazy->new( 'Header => sub { Header $_->level, [ Str $_->string ] }' ); if ( $filter->error ) { say STDERR $lazy->error; say STDERR $lazy->code; } else { $filter->apply(...) }
THIS MODULE IS DEPRECATED AND WILL BE REMOVED.
This module helps creation of Pandoc::Filter with arguments given as string. The following should result in equivalent filters:
Pandoc::Walker::action( ... ); # ... as code Pandoc::Filter::Lazy->new( '...' ) # '...' as string
The script passed as only argument is tried to convert to valid Perl by escaping selectors and adding a missing sub { ... }", for instance
sub { ... }"
Code|CodeBlock => say $_->class
Is converted to
'Code|CodeBlock' => sub { say $_->class }
In addition to the methods inherited from Pandoc::Filter:
Return an error message if compilation of the filter failed.
Return the (possibly cleaned) script arguments to create the filter.
Return a string of Perl code that can be used to create the same filter.
This module is used in command line scripts pandocwalk and pod2pandoc.
To install Pandoc::Elements, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pandoc::Elements
CPAN shell
perl -MCPAN -e shell install Pandoc::Elements
For more information on module installation, please visit the detailed CPAN module installation guide.