NAME

Dist::Zilla::Plugin::Templates::Manual - Hook user manual

VERSION

Version 0.002, released on 2015-08-11 23:13 UTC.

WHAT?

Dist-Zilla-Plugin-Templates (or just Templates) is a Dist-Zilla plugin allowing developers to insert fragments of Perl code into arbitrary text files, which become templates. When building a distribution with Dist::Zilla, Templates plugin evaluates these fragments, and replaces each fragment with result of its evaluation.

This is Templates user manual. Read this if you want to convert any text file into template.

If you are going to hack or extend Dist-Zilla-Plugin-Templates, read the role module documentation. General topics like getting source, building, installing, bug reporting and some others are covered in the readme.

SYNOPSIS

In your dist.ini:

name    = Assa
version = 0.007
…
[Templates]
    templates = :InstallModules
        ; ^ Template files,
        ;   all .pm and .pod files in this example.
    package = MY
        ; ^ Evaluate Perl fragments in context
        ;   of this package.
    prepend = use autodie ':all';
    prepend = use Path::Tiny;
        ; ^ Code to execute in the beginning of
        ;   each fragment.
…

In lib/Assa.pm:

package Assa;
our $VERSION = '{{ $dist->version }}';
…
1;

=head1 RATIONALE

{{
    # Include content of doc/rationale.pod file:
    path( "doc/rationale.pod" )->slurp_utf8;
}}

=head1 COPYRIGHT AND LICENSE

{{ $dist->license->notice }}

=cut

DESCRIPTION

TODO

OPTIONS

The plugin defines only one option templates. Other options (package, prepend, delimiter, …) come from <TextTemplater> role, so see TextTemlater manual for details.

templates

Name of finder to provide files to be treated as templates. The default value is :NoFiles. Use any of standard finders like :InstallModules, :MainModule, :AllFiles (see "default_finders" in Dist::Zilla::Role::FileFinderUser), or create your own finder with FileFinder::ByName and FileFinder::Filter plugins.

EXAMPLES

TODO

WHY?

Err… TODO

SEE ALSO

Dist::Zilla

Distribution builder.

Dist::Zilla::Role::TextTemplate

Bridge between Dist::Zilla and Text::Template, provides templating capabilities to Dist::Zilla plugins, a part of Dist::Zilla distribution. It has limited template engine control and awful error reporting (as of v5.037).

Dist::Zilla::Role::TextTemplater

An alternative to standard Dist::Zilla::Role::TextTemplate, it uses the same template engine, Text::Template, but provides better engine control and error reporting.

Dist::Zilla::Plugin::TemplateFiles

Alternative approach. It does not use file finders, so you have to specify every template file individually. It also uses Dist::Zilla standard TextTemplate role with all the subsequences.

Dist::Zilla::Plugin::GatherDir::Template

A combo of file gathering and templating capabilities. It uses standard TextTemplate role.

Text::Template

The great templating engine used by both TextTemplate and TextTemplater roles.

Dist::Zilla::Plugin::Templates
Dist::Zilla::Plugin::Templates::ReadMe

AUTHOR

Van de Bugger <van.de.bugger@gmail.com>

COPYRIGHT AND LICENSE

Copyright © 2015 Van de Bugger

This file is part of perl-Dist-Zilla-Plugin-Templates.

perl-Dist-Zilla-Plugin-Templates is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

perl-Dist-Zilla-Plugin-Templates is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with perl-Dist-Zilla-Plugin-Templates. If not, see <http://www.gnu.org/licenses/>.