NAME
Dist::Zilla::Plugin::Templates - Convert any text file into template
VERSION
Version v0.6.1, released on 2015-10-31 22:59 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 (C) 2015 Van de Bugger
License GPLv3+: The GNU General Public License version 3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.