SYNOPSIS

    In your weaver.ini

      [GenerateSection]
      title = HOMEPAGE
      text  = This is the POD for distribution {{$name}}. Check out what we have
      text  = been up to at {{$homepage}}

    The title value can be omited if passed as the plugin name:

      [GenerateSection / HOMEPAGE]

DESCRIPTION

    This plugin attempts to be a cross between
    Pod::Weaver::Section::Template and Dist::Zilla::Plugin::GenerateFile
    without the generation of extra files.

    The values of text are concatenated and variable names with matching
    values on the distribution are interpolated. Specifying the heading
    level allows one to write down a rather long section of POD text
    without need for extra files. For example:

      [GenerateSection / FEEDBACK]
      head = 1
      [GenerateSection / Reporting bugs]
      head = 2
      text = Please report bugs when you find them. While we do have a mailing
      text = list, please use the bug tracker at {{$bugtracker_web}}
      text = to report bugs
      [GenerateSection / Homegape]
      head = 2
      text = Also, come check out our other projects at
      text = {{$homepage}}

    The text to be added to the section. Multiple values are allowed and
    will be concatenated. Certain sequences on the text will be replaced
    (see below).

    sub mvp_multivalue_args { return qw(text) } has text => ( is => 'lazy',
    isa => ArrayRef, default => sub { [] }, );

    The heading level of this section. If 0, there will be no heading.
    Defaults to 1. =attr title

    The title for this section. It can optionally be omitted and passed as
    the plugin name. =attr main_module_only

    If true, it will add the text only to the main module POD. Defaults to
    false. =attr is_template

    If false, it will not attempt to replace the {{}} entries on text.
    Defaults to true. =head1 Text as template

    Unless the option is_template is false, the text will be run through
    Text::Template. The variables $plugin, $dist, and $distmeta will be
    provided, set to the GenerateSection plugin, Dist::Zilla object, and
    the distribution metadata hash respectively. For convenience, the
    following variables are also set:

    $name

    $version

    $homepage

    $repository_web

    $repository_url

    $bugtracker_web

    $bugtracker_email

    sub weave_section { my ($self, $document, $input) = @_;

      if ($self->main_module_only) {
        return if $input->{zilla}->main_module->name ne $input->{filename};
      }
    
      my $text = join ("\n", @{ $self->text });
      if ($self->is_template) {
        $text = $self->fill_in_string($text,
        {
          dist      => \($input->{zilla}),
          distmeta  => \($input->{distmeta}),
          plugin    => \($self),
    
          name        => $input->{distmeta}->{name},
          version     => $input->{distmeta}->{version},
          homepage    => $input->{distmeta}->{resources}->{homepage},
          repository_web   => $input->{distmeta}->{resources}->{repository}->{web},
          repository_url   => $input->{distmeta}->{resources}->{repository}->{url},
          bugtracker_web   => $input->{distmeta}->{resources}->{bugtracker}->{web},
          bugtracker_email => $input->{distmeta}->{resources}->{bugtracker}->{mailto},
        });
      }
      $text = Pod::Elemental::Element::Pod5::Ordinary->new({ content => $text });
      if ($self->head) {
        $text = Pod::Elemental::Element::Nested->new({
          command  => "head" . $self->head,
          content  => $self->title,
          children => [$text],
        });
      }
      push @{ $document->children }, $text;
    }

    __PACKAGE__->meta->make_immutable; 1;

POD ERRORS

    Hey! The above document had some coding errors, which are explained
    below:

    Around line 36:

      Unknown directive: =attr

    Around line 49:

      Unknown directive: =attr

