NAME
Dist::Zilla::Plugin::Templates::File - TODO: Convert any text file into template
VERSION
Version 0.003, released on 2015-08-30 18:40 UTC.
SYNOPSIS
In a template:
{{ include( 'as-is.txt' ); }}
{{ include( 'verbatim.txt' )->indent; }}
{{ include( 'template' )->fill_in; }}
DESCRIPTION
This is a helper module for Dist::Zilla::Templates
. It provides few frequently used operations on include files.
OBJECT ATTRIBUTES
_plugin
Reference to the plugin created this object.
Object
, read-only.
OBJECT METHODS
fill_in
$file->fill_in();
Calls plugin's fill_in_file
method, passing $self
as a file argument. Returns $self
.
Primary purpose of the method is including a file which is template itself:
{{ include( 'doc/chapter1.pod' )->fill_in; }}
Without fill_in
, doc/chapter1.pod is included as-is, Perl fragments are not expanded.
indent
$file->indent();
$file->indent( 2 );
Indent file content by inserting specified number of spaces to the beginning of every non-empty line. By default, file is indented with 4 spaces. The method returns $self
for chaining.
Primary purpose of the method is including a file to POD as verbatim paragraphs:
=head2 example.pl
{{ include( 'ex/example.pl' )->indent; }}
chomp
TODO:
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/>.