NAME
Dist::Zilla::Plugin::Templates - Convert any text file into template
VERSION
Version v0.4.1, released on 2015-09-19 18:06 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 Dist::Zilla::Plugin::Templates
module documentation. Read this if you are going to hack or extend Dist-Zilla-Plugin-Templates
.
If you want to convert any text file into template, read the manual. General topics like getting source, building, installing, bug reporting and some others are covered in the README.
DESCRIPTION
Implementation of the plugin is trivial. It just consumes few roles which do all the work: FileFinderUser
provides a list of templates, TextTemplater
process them.
OBJECT METHODS
munge_files
This is the primary method of the plugin. It is called by Dist::Zilla
during build. The method iterates through the files provided by $self->found_files
(a method taken from FileFinderUser
role) and process each file with $self->fill_in_file
(a method taken from TextTemplater
role). That's all, folks.
include
This method implements same-name template function. Normally, templates should call the function, not method:
{{ include( 'filename' ); }}
However, if something wrong with the function, file inclusion can be made through the method call:
{{ $plugin->include( 'filename' ); }}
SEE ALSO
- Dist::Zilla
- Dist::Zilla::Role::FileFinderUser
- Dist::Zilla::Role::TextTemplater
- Text::Template
- Dist::Zilla::Plugin::Templates::Manual
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/>.