Index
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- CLASS METHODS
- OBJECT METHODS
- INTERNAL METHODS
- REQUIRES
- INSTALLATION
- AUTHOR
- BUGS
- COPYRIGHT AND LICENSE
NAME
Module::Starter::Plugin::Template::TeTe - Module::Starter plugin for Text::Template templates
VERSION
This describes version 0.06 of Module::Starter::Plugin::Template::TeTe
SYNOPSIS
use Module::Starter qw( Module::Starter::Simple Module::Starter::Plugin::Template Module::Starter::Plugin::Template::TeTe ); Module::Starter->create_distro(%args);
DESCRIPTION
This plugin is designed to be added to a Module::Starter::Simple-compatible Module::Starter class. It uses the API provided by Module::Starter::Plugin::Template and implements "render" and "templates" methods using the Text::Template template system.
CLASS METHODS
new(%args)
This plugin calls the new
supermethod and then sets various defaults.
Note that this will also set itself from the @ARGV array.
This takes the following arguments in addition to its parents:
- DELIMITERS => ['[==', '==]']
-
Delimiters used to mark template text. (default '[==' and '==]') If the user wishes to change the delimiters, they need to make sure that they have template files for all the used templates, because if a template is missing, the default template will be used, and they use the default delimiters.
- template_dir => directory
-
Name of the directory to look for templates. If this is not set, then all the templates will simply be the default ones.
- version => version_string
-
Define the version, in case you don't want to use the default '0.01'.
- need_new_method => 1
-
If your module is object-oriented, then it will need a "new" method. (default: off)
OBJECT METHODS
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 (file)name and each value is the body of the template. The name "Module.pm" is used for the module template.
renderer()
This method is used to initialize the template renderer. Its result is
stored in the object's renderer
entry.
In this case, no renderer is created, because the Text::Template needs to be created per template, so there's nothing to make here.
render($template, \%options)
The render
method will render the template passed to it, using the
data in the Module::Starter object and in the hash of passed parameters.
create_template_directory($directory)
Module::Starter::Plugin::Templates::TeTe-> create_template_directory( $directory );
Creates the named $directory and populates it with a file for each default template. These can be customized and the directory used in conjunction with the template_dir configuration option. Returns a true value if successful.
INTERNAL METHODS
These methods are used internally. They are documented for developer purposes only and may change in future releases. End users are encouraged to avoid using them.
default_templates()
$self->default_templates();
Generates the default templates from <<HERE statements in the code. Returns a hash containing the default templates.
Templates included are:
* Module.pm * Makefile.PL * Build.PL * Changes * README * 00_dist.t * 01_load.t * pod.t * pod-coverage.t * MANIFEST * MANIFEST.SKIP * cvsignore * Todo
REQUIRES
File::Spec Text::Template Module::Starter Module::Starter::Plugin::Template
INSTALLATION
To install this module, run the following commands:
perl Build.PL ./Build ./Build test ./Build install
AUTHOR
Kathryn Andersen (RUBYKAT), <perlkat AT katspace dot com>
BUGS
Please report any bugs or feature requests to the author at the above address.
COPYRIGHT AND LICENSE
Copyright (c) 2004 Kathryn Andersen
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.