[Templates-cvs] cvs commit: TT3/misc README skeleton.pm

cvs@template-toolkit.org cvs@template-toolkit.org
Wed, 03 Dec 2003 18:28:40 +0000


cvs         03/12/03 18:28:38

  Added:       misc     README skeleton.pm
  Log:
  added misc directory including a skeleton template for generating boilerplate text and documentation stub for TT modules
  
  Revision  Changes    Path
  1.1                  TT3/misc/README
  
  Index: README
  ===================================================================
  This directory contains miscellaneous files relating to TT.
  
    skeleton.pm     A skeleton template for creating a new TT module.
  
  
  
  
  1.1                  TT3/misc/skeleton.pm
  
  Index: skeleton.pm
  ===================================================================
  [%# Usage:
    #
    #   $ tpage --define name='MyModule'  \
    #   >       --define about='My Template Toolkit module'  \
    #   >       --define description='Longer description of this module'  \
    #   >       --define author='Your Name <your@email.org>'
    #   >       skeleton.pm > MyModule.pm
  -%]
  [%  DEFAULT 
        name   = 'YetAnotherModule'
        author = 'Andy Wardley  <abw@wardley.org>'
        about  = 'Yet another Template::Toolkit module'
        description = 'This is yet another Template::Toolkit module with a '
                    _ 'slightly longer description saying what it does.'
  -%]
  #============================================================= -*-perl-*-
  #
  # Template::Toolkit::[% name %]
  #
  # DESCRIPTION
  [% USE wrap; wrap(description, 72, '#   ', '#   ') %]
  #
  # AUTHOR
  #   [% author %]
  #
  # COPYRIGHT
  #   Copyright (C) 1996-2003 Andy Wardley.  All Rights Reserved.
  #   Copyright (C) 1998-2002 Canon Research Centre Europe Ltd.
  #
  #   This module is free software; you can redistribute it and/or
  #   modify it under the same terms as Perl itself.
  #
  # REVISION
  #   $Id: skeleton.pm,v 1.1 2003/12/03 18:28:38 abw Exp $
  #
  #========================================================================
  
  package Template::Toolkit::[% name %];
  
  use strict;
  use warnings;
  use Template::Toolkit::Base;
  use vars qw( $VERSION $DEBUG $ERROR $WARNING );
  use base qw( Template::Toolkit::Base );
  
  $VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);
  $DEBUG   = 0 unless defined $DEBUG;
  $ERROR   = '';
  
  
  
  1;
  __END__
  
  =head1 NAME
  
  Template::Toolkit::[% name %] - [% about %]
  
  =head1 SYNOPSIS
  
      use Template::Toolkit::[% name %]
  
      # TODO
  
  =head1 DESCRIPTION
  
  [% wrap(description, 72) %]
  
  # MORE TODO
  
  =head1 METHODS
  
  =head2 method1()
  
  # TODO
  
  =head2 method2()
  
  # TODO
  
  =head1 AUTHOR
  
  [% author.replace('<', 'E[lt]').replace('>', 'E<gt>').replace('E\[lt\]', 'E<lt>') %]
  
  =head1 VERSION
  
  $Revision: 1.1 $
  
  =head1 COPYRIGHT
  
    Copyright (C) 1996-2003 Andy Wardley.  All Rights Reserved.
    Copyright (C) 1998-2002 Canon Research Centre Europe Ltd.
  
  This module is free software; you can redistribute it and/or
  modify it under the same terms as Perl itself.
  
  =head1 SEE ALSO
  
  # TODO
  
  =cut
  
  # Local Variables:
  # mode: perl
  # perl-indent-level: 4
  # indent-tabs-mode: nil
  # End:
  #
  # vim: expandtab shiftwidth=4: