Permalink
Browse files

initial import from cpan

  • Loading branch information...
0 parents commit 27483ce3850bab831895ca911e24f47e40118748 @2shortplanks committed Jan 27, 2012
Showing with 267 additions and 0 deletions.
  1. +15 −0 Build.PL
  2. +3 −0 CHANGES
  3. +8 −0 MANIFEST
  4. +16 −0 META.yml
  5. +11 −0 Makefile.PL
  6. +93 −0 README
  7. +83 −0 lib/Template/Plugin/Textile.pm
  8. +38 −0 t/01basic.t
@@ -0,0 +1,15 @@
+use Module::Build;
+
+my $build = new Module::Build
+(
+ module_name => 'Template::Plugin::Textile',
+ license => 'perl',
+ requires => {
+ Template => 2.00,
+ Text::Textile => 0.5,
+ },
+ create_makefile_pl => 'traditional',
+);
+
+$build->create_build_script;
+
@@ -0,0 +1,3 @@
+1.01 Altered bug in POD spotted by Tom Insam
+
+1.00 Initial release
@@ -0,0 +1,8 @@
+Build.PL
+CHANGES
+lib/Template/Plugin/Textile.pm
+Makefile.PL
+MANIFEST This list of files
+META.yml
+README
+t/01basic.t
@@ -0,0 +1,16 @@
+--- #YAML:1.0
+name: Template-Plugin-Textile
+version: 1.01
+license: perl
+distribution_type: module
+requires:
+ Template: 2
+ Text::Textile: 0.5
+recommends: {}
+build_requires: {}
+conflicts: {}
+provides:
+ Template::Plugin::Textile:
+ file: lib/Template/Plugin/Textile.pm
+ version: 1.01
+generated_by: Module::Build version 0.18_02
@@ -0,0 +1,11 @@
+ use ExtUtils::MakeMaker;
+ WriteMakefile
+ ('DISTNAME' => 'Template-Plugin-Textile',
+ 'VERSION' => '1.01',
+ 'PL_FILES' => {},
+ 'PREREQ_PM' => {
+ 'Text::Textile' => '0.5',
+ 'Template' => '2',
+
+ },
+ );
@@ -0,0 +1,93 @@
+ Textile Plugin for the Template Toolkit
+
+ Version 1.00
+
+ 12th June 2003
+
+ Copyright (C) 2003 Profero. All Rights Reserved
+
+ This is free software; you can redistribute it and/or
+ modify it under the same terms as Perl itself.
+
+Hmm, most people will never read this as they'll download with
+CPANPLUS or CPAN. Here's hoping they click on it from a link from
+http://search.cpan.org/
+
+STOP: Do you want the main documentation by typing
+ "perldoc Template::Plugin::Textile" ?
+
+DESCRIPTION
+-----------
+
+This is a plugin for Textile for the Template Toolkit.
+
+It allows you to do things like this:
+
+ [% USE Textile -%]
+ [% FILTER textile %]this is _like_ *so* *cool*[% END %]
+
+And get back things like this:
+
+ <p>this is <em>like</em> <strong>so* *cool</strong></p>
+
+INSTALL
+-------
+
+Just like any other Perl module:
+
+ tar zxf Template-Plugin-Textile-X.XX.tar.gz
+ cd Template-Plugin-Textile-X.XX
+ perl Makefile.PL
+ make
+ make test
+ make install (as root, or with sudo, etc)
+
+Or, if you're using the new Module::Build install method:
+
+ tar zxf Template-Plugin-Textile-X.XX.tar.gz
+ cd Template-Plugin-Textile-X.XX
+ perl Build.PL
+ ./Build
+ ./Build test
+ ./Build install (as root, or with sudo, etc)
+
+This requires
+
+ * The Template Toolkit version 2.06 or later
+ * Text::Textile 0.5 or later
+
+SUPPORT
+-------
+
+This code is provided as is, and is offered with no guarantee.
+
+This having been said, you may request our voluntary support in one of
+two ways:
+
+ 1) Use the CPAN RT:
+ http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Plugin-Textile
+
+ 2) Mail the Profero open source development team directly:
+ profero@cpan.org
+
+Problems with the underlying Text::Textile module probably should be
+addressed to Tom Insam E<lt>tom@jerakeen.orgE<gt>.
+
+AUTHOR
+------
+
+The thin wrapper code (all ten lines of it) was written by Mark Fowler
+E<lt>mark@twoshortplanks.comE<gt>.
+
+The B<Text::Textile> module that does all the work was written by Tom
+Insam E<lt>tom@jerakeen.orgE<gt>, and in his own words 'All the clever
+things in Text::Textile were written by Brad Choate
+E<lt>http://www.bradchoate.comE<gt>'
+
+COPYRIGHT
+---------
+
+Copyright (C) 2003 Profero. All Rights Reserved.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
@@ -0,0 +1,83 @@
+package Template::Plugin::Textile;
+
+use strict;
+#use warnings;
+
+use vars qw($VERSION);
+$VERSION = "1.01";
+
+use Text::Textile;
+
+sub load { return $_[0] }
+sub new { return bless {}, $_[0] }
+
+$Template::Filters::FILTERS->{textile}
+ = sub { Text::Textile::textile($_[0]) };
+
+1;
+
+__END__
+
+=head1 NAME
+
+Template::Plugin::Textile - textile plugin for the Template Toolkit
+
+=head1 SYNOPSIS
+
+ [% USE Textile -%]
+ [% FILTER textile %]this is _like_ *so* *cool*[% END %]
+
+ <p>this is <em>like</em> <strong>so* *cool</strong></p>
+
+=head1 DESCRIPTION
+
+This is a very thin wrapper around Text::Textile for the Template
+Toolkit. When you load the plugin, it creates a filter called C<textile>
+that you can use in the normal way
+
+ [% text = BLOCK -%]
+ The "Template Toolkit":http://www.tt2.org was written by Andy Wardly.
+ !http://www.perl.com/supersnail/os2002/images/small/os6_d5_5268_w2_sm.jpg!
+ This image (c) Julian Cash 2002
+ [%- END %]
+
+ [% text | textile %]
+
+Or
+
+ [% FILTER textile %]
+ Reasons to use the Template Toolkit:
+
+ * Seperation of concerns.
+ * It's written in Perl.
+ * Badgers are Still Cool.
+ [% END %]
+
+=head1 BUGS
+
+None known (it's only ten lines of code.)
+
+Bugs (and requests for new features) can be reported to the open source
+development team at Profero though the CPAN RT system:
+<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Plugin-Textile>
+
+=head1 AUTHOR
+
+The thin wrapper code (all ten lines of it) was written by Mark Fowler
+E<lt>mark@twoshortplanks.comE<gt>.
+
+The B<Text::Textile> module that does all the work was written by Tom
+Insam E<lt>tom@jerakeen.orgE<gt>, and in his own words 'All the clever
+things in Text::Textile were written by Brad Choate
+E<lt>http://www.bradchoate.comE<gt>'
+
+Copyright Profero 2003. All rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<Text::Textile>, L<Template>, L<Template::Plugin>, L<Template::Filters>
+
+=cut
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use Template::Test;
+test_expect(\*DATA);
+
+__DATA__
+-- test --
+[% USE Textile -%]
+[% FILTER textile %]this is _like_ *so* *cool*[% END %]
+-- expect --
+<p>this is <em>like</em> <strong>so* *cool</strong></p>
+-- test --
+[% FILTER textile -%]
+Reasons to use the Template Toolkit:
+
+* Seperation of concerns.
+* It's written in Perl.
+* Badgers are Still Cool.
+[%- END %]
+-- expect --
+<p>Reasons to use the Template Toolkit:</p>
+
+<ul><li>Seperation of concerns.</li>
+<li>It's written in Perl.</li>
+<li>Badgers are Still Cool.</li>
+</ul>
+-- test --
+[% text = BLOCK %]
+The "Template Toolkit":http://www.tt2.org was written by Andy Wardly.
+!http://www.perl.com/supersnail/os2002/images/small/os6_d5_5268_w2_sm.jpg!
+This image (c) Julian Cash 2002
+[% END -%]
+
+[%- text | textile %]
+-- expect --
+<p>The <a href="http://www.tt2.org">Template Toolkit</a> was written by Andy Wardly.<br />
+<img src="http://www.perl.com/supersnail/os2002/images/small/os6_d5_5268_w2_sm.jpg" /><br />
+This image &copy; Julian Cash 2002</p>

0 comments on commit 27483ce

Please sign in to comment.