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

NAME

Muster::Hook::FieldSubst - Muster hook for field substitution

VERSION

version 0.62

SYNOPSIS

  # CamelCase plugin name
  package Muster::Hook::FieldSubst;
  use Mojo::Base 'Muster::Hook';

DESCRIPTION

Muster::Hook::FieldSubst does field substition; that is, it replaces a "field macro" with the content of that field (aka the meta-data for the Leaf).

The pattern for fields is "{{$fieldname}}".

METHODS

register

Initialize, and register hooks.

process

Process (scan or modify) a leaf object. In scanning phase, this will do simple substitutions of known meta-data (for example, "page"). In assembly phase, it will do the same, but the contents of the Leaf meta-data will likely be more complete.

In either case, this expects the leaf meta-data to be populated.

  my $new_leaf = $self->process(%args);

get_field_value

Get the field value for this page.

get_other_page_field_value

Get the field value for a different page.