The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Pandoc::Filter::Lazy - facilitate creation of filters (deprecated)

SYNOPSIS

  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(...)
  }
 

DESCRIPTION

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

  Code|CodeBlock => say $_->class

Is converted to

  'Code|CodeBlock' => sub { say $_->class }

METHODS

In addition to the methods inherited from Pandoc::Filter:

error

Return an error message if compilation of the filter failed.

script

Return the (possibly cleaned) script arguments to create the filter.

code( [ indent => $indent, ] [ function => $function ] )

Return a string of Perl code that can be used to create the same filter.

SEE ALSO

This module is used in command line scripts pandocwalk and pod2pandoc.