.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Module::Starter::Plugin::Template 3pm" .TH Module::Starter::Plugin::Template 3pm "2020-09-08" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Module::Starter::Plugin::Template \- module starter with templates .SH "VERSION" .IX Header "VERSION" version 1.77 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use Module::Starter qw( \& Module::Starter::Simple \& Module::Starter::Plugin::Template \& ); \& \& Module::Starter\->create_distro(%args); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This plugin is designed to be added to a Module::Starter::Simple\-compatible Module::Starter class. It adds stub methods for template retrieval and rendering, and it replaces all of Simple's _guts methods with methods that will retrieve and render the appropriate templates. .SH "CLASS METHODS" .IX Header "CLASS METHODS" .ie n .SS """new(%args)""" .el .SS "\f(CWnew(%args)\fP" .IX Subsection "new(%args)" This plugin calls the \f(CW\*(C`new\*(C'\fR supermethod and then initializes the template store and renderer. (See \f(CW\*(C`templates\*(C'\fR and \f(CW\*(C`renderer\*(C'\fR below.) .SH "OBJECT METHODS" .IX Header "OBJECT METHODS" .ie n .SS """templates()""" .el .SS "\f(CWtemplates()\fP" .IX Subsection "templates()" This method is used to initialize the template store on the Module::Starter object. It returns a hash of templates; each key is a filename and each value is the body of the template. The filename \fIModule.pm\fR is used for the module template. .ie n .SS """renderer()""" .el .SS "\f(CWrenderer()\fP" .IX Subsection "renderer()" This method is used to initialize the template renderer. Its result is stored in the object's \f(CW\*(C`renderer\*(C'\fR entry. The implementation will determine its use. .ie n .SS """render($template, \e%options)""" .el .SS "\f(CWrender($template, \e%options)\fP" .IX Subsection "render($template, %options)" The \f(CW\*(C`render\*(C'\fR method will render the template passed to it, using the data in the Module::Starter object and in the hash of passed parameters. .SS "_guts methods" .IX Subsection "_guts methods" All of the \f(CW\*(C`FILE_guts\*(C'\fR methods from Module::Starter::Simple are subclassed to look something like this: .PP .Vb 4 \& sub file_guts { \& my $self = shift; \& my %options; \& @options{qw(first second third)} = @_; \& \& my $template = $self\->{templates}{filename}; \& $self\->render($template, \e%options); \& } .Ve .PP These methods will need to be rewritten when (as is likely) Module::Starter::Simple's _guts methods are refactored into a registry. .IP "module_guts" 4 .IX Item "module_guts" .PD 0 .IP "Makefile_PL_guts" 4 .IX Item "Makefile_PL_guts" .IP "MI_Makefile_PL_guts" 4 .IX Item "MI_Makefile_PL_guts" .IP "Build_PL_guts" 4 .IX Item "Build_PL_guts" .IP "Changes_guts" 4 .IX Item "Changes_guts" .IP "README_guts" 4 .IX Item "README_guts" .IP "t_guts" 4 .IX Item "t_guts" .IP "MANIFEST_guts" 4 .IX Item "MANIFEST_guts" .IP "ignores_guts" 4 .IX Item "ignores_guts" .PD .SH "AUTHOR" .IX Header "AUTHOR" Ricardo \s-1SIGNES,\s0 \f(CW\*(C`\*(C'\fR .SH "Bugs" .IX Header "Bugs" Please report any bugs or feature requests to the bugtracker for this project on GitHub at: . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2005\-2007 Ricardo \s-1SIGNES,\s0 All Rights Reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.