Re: [Templates] TT3 development…?

2011-07-07 Thread Clinton Gormley
> I'm hoping for an alpha release in time for the London Perl Workshop > this year (November-ish). > just before christmas... ___ templates mailing list templates@template-toolkit.org http://mail.template-toolkit.org/mailman/listinfo/templates

Re: [Templates] TT3 development…?

2011-07-07 Thread Clinton Gormley
On Thu, 2011-07-07 at 11:37 -0500, Felipe Gasper (cPanel) wrote: > Hi all, > > According to GitHub, there haven’t been any commits for a year and a > half…I’m just curious, what is the status of TT3? TT3 is in pretty good shape. Andy is currently working on a C backend: https://github.com

Re: [Templates] Template localization for email

2011-03-09 Thread Clinton Gormley
Hi Bill On Thu, 2011-03-03 at 08:14 -0800, Bill Moseley wrote: > I use TT for generating email. Unlike many our our web pages where > often there are not that many strings to localize (I just use [% > loc( 'Log out' ) %]), the email templates are almost entirely text. > So, it doesn't make a lot

Re: [Templates] [OT] Re: removing whitespace problem

2011-02-07 Thread Clinton Gormley
On Mon, 2011-02-07 at 09:15 -0700, Larry Leszczynski wrote: > > Note: In English, we don't use "a, b, and c", but "a, b and c" > > Not necessarily: http://en.wikipedia.org/wiki/Serial_comma thanks - didn't know that clint ___ templates mailing list

Re: [Templates] removing whitespace problem

2011-02-07 Thread Clinton Gormley
On Mon, 2011-02-07 at 15:22 +0100, Jiří Pavlovský wrote: > Hi, > > I Have a block like below. It will produce the following output when > included with the 'collapse' filter.: > > "- name1 , name2 , and name 3 en". [% # non-destructive copy # drop .merge if you don't care if it is destr

Re: [Templates] TT "editor" for Eclipse - alpha release

2010-06-12 Thread Clinton Gormley
On Fri, 2010-06-11 at 10:35 -0700, Benjamin Hitz wrote: > > > By popular demand: > git://github.com/hitz/eclipse-tteditor.git Nice work. Now when are you following this up with TT Tidy ;) clint ___ templates mailing list templates@template-toolkit.o

Re: [Templates] TT "editor" for Eclipse

2010-06-03 Thread Clinton Gormley
On Thu, 2010-06-03 at 08:06 -0400, Todd Freeman wrote: > Woohoo! Count me in as being interested. We built an in house CMS that > uses subversion and TT so being able to pop those up in eclipse while > working on the perl code behind it would be awesome. yep - me too! clint > > > > On 06/0

Re: [Templates] error in while statement

2010-03-24 Thread Clinton Gormley
> Argument "" isn't numeric in numeric lt (<) at > /home/savio/netstore/templates/src/page.html line 57. > > launched by this line: > > [% counter = 0 %] > [% WHILE (counter < info.size) %] info isn't defined, so info.size is also undefined (but is converted to the empty string), so you're doi

Re: [Templates] Extracting strings for localization.

2009-12-21 Thread Clinton Gormley
> > A nice feature would be to pass in a list of names to match in case > you use something other than l() or loc(). sure, but starts making the command line look quite complicated ;) > > I have not thought about this much, but would a better approach to > just extract out all quoted text? W

Re: [Templates] Extracting strings for localization.

2009-12-21 Thread Clinton Gormley
> > Doesn't that extract text from just loc() tags? Sorry, I was not > clear . I'm not trying to extract text form loc() calls, but from > quoted strings in general. I already have a tool to find the loc() > text. Ah ok. Yeah, xgettext.pl just extracts from text in l() or loc(), not quoted s

Re: [Templates] Extracting strings for localization.

2009-12-21 Thread Clinton Gormley
Hi Bill On Mon, 2009-12-21 at 07:51 +, Andy Wardley wrote: > Yes, you can, but Clint's already done it. See this message: > > http://mail.template-toolkit.org/pipermail/templates/2008-October/010493.html > As Andy said, this already works in Locale::Maketext::Lexicon, specifically: http

Re: [Templates] perl warnings in apache logs

2009-10-22 Thread Clinton Gormley
> The warnings are important. I find they catch mistakes in templates > (or in the stash). Just this week we have new Template coders and the > warnings have already been helpful to find mistakes. > > Interestingly enough, the suppression of the undefined values (foo.bar > when foo is undefined

Re: [Templates] perl warnings in apache logs

2009-10-21 Thread Clinton Gormley
> > perl -MTemplate -le 'Template->new->process(\q[[% 1 + "" %]])' > Argument "" isn't numeric in addition (+) at input text line 1. > 1 > > What could I be missing (or not)? I get it with perl 5.10, but not with perl 5.8 clint ___ templates mail

Re: [Templates] Compile once, use many?

2009-10-15 Thread Clinton Gormley
> Essentially, I may have a need to process a template repeatedly. So, I > get the understanding that I can basically compile/cache a template so I > can use that for best performance rather than re-reading the template in > every call to (Template) process. > > But I'm having trouble figuring

Re: [Templates] how to fix this dangling else problem?

2009-08-13 Thread Clinton Gormley
> The problem is that the ELSE is being matched with the outer IF, not > the inner IF. I haven't seen that before, but in your code, you are missing an END: [% FOREACH x = aList %] [% IF loop.index > 0; a = ...; b = ...; c = ...; IF x.disabled;

Re: [Templates] Error objects

2009-06-11 Thread Clinton Gormley
Hi Andy > That's a possibility. In fact TT2 already supports dotted exception types > so we could throw file.syntax and file.missing exceptions and they would > both be caught by existing [% CATCH file %] handlers. There would be little > or no breakage there, while allowing the likes of you and

Re: [Templates] Error objects

2009-06-10 Thread Clinton Gormley
> The only problem with this would be that we might break things if > syntax errors are moved from 'file'. I'm pretty sure I have in the > past coded around this and switching from file to syntax would break a > page or two I have. Yeah, I wasn't expecting it to happen for TT2 - more of a request

[Templates] Error objects

2009-06-10 Thread Clinton Gormley
Hi all Just a feature request: It's rather annoying that file-not-found and syntax errors both throw 'file' errors. I sometimes want to use a custom template if it exists, otherwise fall back to the default. But using "CATCH file" makes it difficult to debug, as any syntax errors are also caught

Re: [Templates] Called UNIVERSAL::can() as a function, not a method

2009-05-12 Thread Clinton Gormley
On Tue, 2009-05-12 at 12:47 +0100, Andy Wardley wrote: > On 12/5/09 12:27, Chisel Wright wrote: > > They did all pass: > > Fair enough, patch applied. > >http://template-toolkit.org/svnweb/Template2/revision/?rev=1201 > > Thanks Chisel. That'll get the UNIVERSAL::can() crowd off my back :-)

Re: [Templates] Fwd: PROCESS directive within a CASE clause

2009-04-08 Thread Clinton Gormley
> > If anybody is able to help I have one other question. As I said, we're > trying to translate our website into other languages and make it > easier for volunteers to do the translations without having to read > over lots of template code. > > We have split out all translateable text strings i

[Templates] RFC for users of Locale::Maketext::Lexicon

2008-11-23 Thread Clinton Gormley
Hi all I'm a co-maintainer of Locale::Maketext::Lexicon and I'd like to make a change to the format of the .po file created by Locale::Maketext::Extract / xgettext.pl. Currently it writes out each entry in the .po file as: #: $filename_1:$line $filename_2:$line ... #. (vars passed to ma

Re: [Templates] Template::PO

2008-10-31 Thread Clinton Gormley
This is a bit of a diversion, but... On Wed, 2008-10-29 at 22:24 -0500, Lee.M wrote: > Locale::Maketext::Lexicon can do .po files, and it now has special TT > and YAML formats although I've got to say I'm not a fan of the gettext > style _(thingy)... too ambiguous but that's just me :) Actually,

[Templates] New release of Locale::Maketext::Lexicon with better options for TT

2008-10-05 Thread Clinton Gormley
Hi all Some of you may remember me asking about typical file extensions used for your TT and YAML files. I submitted a large patch to Locale::Maketext::Extract / xgettext.pl which has just been accepted and released to CPAN. You can download it here: http://search.cpan.org/~audreyt/Locale-Makete

[Templates] Commonly used file extensions for Template Toolkit

2008-09-15 Thread Clinton Gormley
Hi all Quick survey : what file extensions do you typically use for your TT templates? - .tt - .html - ??? Bonus question: what file extensions do you use for your YAML files? - .yaml - .yml - .conf - ??? Some background: I'm in the process of extending Locale::Maketext:

Re: [Templates] Makefile.PL will no longer install examples, libraries, HTML docs, etc

2008-08-07 Thread Clinton Gormley
On Thu, 2008-08-07 at 14:26 +0100, Andy Wardley wrote: > Is anyone likely to object strongly if I remove all the installation of all > the extra cruft from the Makefile.PL? Things like HTML docs, various template > libraries, examples, etc. The HTML docs have been superceded by what's on the > we

Re: [Templates] [PATCH] Allow undefined values in Stash

2008-08-06 Thread Clinton Gormley
> I think to do the job properly, the whole stash should differentiate between > "found", "not found", "found but undefined", and "error". But I think major > changes like that should wait until TT3 (which is getting closer). Is it Christmas already? :) Go-Andy-GO! clint

Re: [Templates] Unicode problem

2008-03-25 Thread Clinton Gormley
You're not specifying UTF8 anywhere: > $template->process('utf-example.tmpl', $vars) > || die "Template process failed: ", $template->error(), "\n"; >From the docs: Alternately, the binmode argument can specify a particular IO layer such as ":utf8". $tt->process($infile, $vars, $outfile, binmod

[Templates] Feature request : BEGIN or CONSTANT blocks

2008-03-06 Thread Clinton Gormley
Hi all There may be a better way of doing this that I don't know about, but assuming there isn't: Context: - I'm running a number of white labelled sites, in each of which, there may be 400 "sub-brands" - Each white label site has it's own template which sets the the configura

Re: [Templates] Replacing literal back slashes

2008-03-01 Thread Clinton Gormley
> Try putting the \\n inside of single quotes. The \\n is probably being > interpolated twice. Once inside the double quotes "" to be \n and then > one more time inside of the regular expression. > In fact, it's even more than that. To get it to work, you need to use this: [% Foo.replace: [% f

Re: [Templates] Getting keys from a hash

2008-02-26 Thread Clinton Gormley
> Tied variables behave strange in some aspects, and I guess this is one > of them. I think that TT gets stuck when trying to find out whether > cgihash is an object which implements a 'keys' method or a hash which > should respond to the 'keys' vmethod. action at a distance. nasty... ___

Re: [Templates] Getting keys from a hash

2008-02-26 Thread Clinton Gormley
On Tue, 2008-02-26 at 11:00 +, Karl Dane wrote: > I guess my example wasn't a very good one - I just wanted to demonstrate > that I was getting _nothing_ when using the keys method. If it had > worked as expected, then it should have returned something like > 'ARRAY(0x8a8ca58)' ... which is

Re: [Templates] Apache::Template, Plugins and UTF-8 OH MY!

2008-02-15 Thread Clinton Gormley
Hi Todd I'm not sure if this is the problem, but it may be at least PART of the problem. As I understand it, TT either needs to be told explicitly to use UTF8 in the process() call, or it needs a UTF8-BOM at the beginning of the template to know that it should treat the template (and the included

Re: [Templates] amusing template engine story

2008-02-09 Thread Clinton Gormley
On Fri, 2008-02-08 at 15:59 -0500, Perrin Harkins wrote: > This one is Python, but I'm sure you all get the joke: > http://www.codeirony.com/?p=9 > What's astounding is the number of blog commenters who didn't! Clint ___ templates mailing list templ

Re: [Templates] Plugins and wrappers

2007-09-12 Thread Clinton Gormley
Hiya Personally, I think that using a plugin for this is probably over complicating things. I would just do this: - in story.tt: css_includes.story = 1 - in global_wrapper.tt: FOREACH css = ['sports_wrapper','story','video_player']; IF css_includes.$css;

Re: [Templates] Including a BLOCK fails - TT looks for file

2007-07-13 Thread Clinton Gormley
On Fri, 2007-07-13 at 13:53 -0500, Matt DeLeon wrote: > I am using Metadot Portal Software, which is running TT 2.15. And > yes, the exact code I gave you fails. I've contacted the metadot > support center but with little success. > You have a block named 'someblockname'? If not, then please g

Re: [Templates] form "validation"

2007-07-09 Thread Clinton Gormley
Nothing TT specific that I know of, but have a look in CPAN for various CAPTCHA modules: http://search.cpan.org/search?query=captcha&mode=module Clint On Mon, 2007-07-09 at 21:27 +0100, Travis Basevi wrote: > Does anyone know of a tt2 plugin to create a random string as an image, > the thing a

Re: [Templates] Calling class methods with parameters from templates

2007-07-03 Thread Clinton Gormley
> my $runner = $suite->get_runner(ENVIRONMENT => 'PROD'); > > I've tried to: > > [% runner = suite.get_runner(ENVIRONMENT => env) %] > [% runner = suite.get_runner('ENVIRONMENT' => env) %] ... should do the trick ___ templates mailing list templa

Re: [Templates] Is there something like TT2Editor plugin for Eclipse

2007-05-04 Thread Clinton Gormley
> The EPIC plugin for Eclipse seams invaluable for me in Eclipse. > I use the Eclipse HTML editor for *.tt files. > Do you know a way to extend or configure it so I can get proper syntax > coloring for *.tt files. > Or do you know a plugin for editing TT2 in Eclipse. > I searched using Google but

Re: [Templates] question on dynamically include

2007-04-27 Thread Clinton Gormley
On Fri, 2007-04-27 at 12:13 -0700, James. L wrote: > hi, > > i have few pre-generated html files(not a complete > html) that i want to include in my other template > dynamically based on user request. such as: > > [% INCLUDE header.tt %] > [% INCLUDE html/$foo %] [% INSERT "html/${foo}" %] IN

[Templates] TinyMCE perl compressor

2007-04-26 Thread Clinton Gormley
Just a follow up to my previous announcement. The TinyMCE perl compressor now has a permanent home: http://hacks.traveljury.com/perl_compressor any bugs to me: [EMAIL PROTECTED] About TinyMCE Compressor gzips all javascript files in TinyMCE to a single streamable file. This makes the overall do

[Templates] Performance cost of 'namespaces'

2007-04-26 Thread Clinton Gormley
One of the issues that I am finding in my templates as they become more complex, is the problem of namespace collision, ie just remembering what variables I have used where, and whether using this variable name is going to cause problems at a distance. I use PROCESS rather than INCLUDE to process

Re: [Templates] Question about this list

2007-04-24 Thread Clinton Gormley
On Tue, 2007-04-24 at 08:37 -0700, ttfn wrote: > Hi all, > > Or is this the right list and there's very little hair-pulling because > everyone > here has passed through the hair-pulling phase and is now into the > sit-back-n-watch-it-go phase? It's the right list, we've just been discussing deve

Re: [Templates] Proposed patch for truncate()

2007-04-20 Thread Clinton Gormley
> Obviously we don't want to go changing the order of the first two > parameters because it'll break existing code. But tagging the min > parameter on the end feels pretty wrong too. It's not very intuitive > or obvious as to why it's that way (other than "backwards compatibility"). Yup, I agre

Re: [Templates] Hash delete Vmethod Doesn't Return value(s)

2007-04-02 Thread Clinton Gormley
On Mon, 2007-04-02 at 11:35 -0600, Josh Rosenbaum wrote: > It seems to me that the hash.delete() vmethod should return the > value(s) it deletes. Anybody have any thoughts on that? I was excited > to get to remove my vmethod for this only to find out the new one > doesn't return my values. > I ag

Re: [Templates] Proposed patch for truncate()

2007-03-28 Thread Clinton Gormley
> I will make changes to the filter as well, and post proper diffs for > both of them. > OK - here is a diff with my suggested changes made to both Template::Filter::truncate_filter_factory and Template::Plugin::String::truncate; It doesn't break or alter the previous behaviour, but instead turn

Re: [Templates] Proposed patch for truncate()

2007-03-26 Thread Clinton Gormley
> This code appears to be based on the String plugin rather than the > truncate filter. Are you trying to change the filter instead or both > maybe? I didn't even know that Template::Plugin::String existed - a quick (and erroneous grep)... But it would make sense if both worked in the same way.

Re: [Templates] Proposed patch for truncate()

2007-03-26 Thread Clinton Gormley
n Sun, 2007-03-25 at 23:10 -0500, Jonathan Rockway wrote: > On Thursday 22 March 2007 12:39, Clinton Gormley wrote: > > Hi all > > > > The truncate filter doesn't do what I would like it to do. > > Why don't you implement it as a plugin/filter and then put it on

Re: [Templates] Proposed patch for truncate()

2007-03-22 Thread Clinton Gormley
Whoops, missing a CORE:: > > sub truncate { > my ($self,$max,$suffix,$min) = @_; > > return $self unless defined $max; > > $suffix||=''; > my $string = $self->{ text }; > return $self if CORE::length $string < $max; > $max-=CORE::length($suffix); > $m

[Templates] Proposed patch for truncate()

2007-03-22 Thread Clinton Gormley
Hi all The truncate filter doesn't do what I would like it to do. I would prefer if it broke on whitespace, rather than at the exact length that I specify. So I'd prefer : "the cat sat on the..." to : "the cat sat on the m..." However, I'd prefer : "I said supercalafragalisticexpia

[Templates] Tiny MCE Perl compressor

2007-03-15 Thread Clinton Gormley
ipt or using mod_perl (example in the README) If you find any issues or can suggest any improvements (for instance, a better example of using it with mod_perl?), please send them to me - I'll be happy to fix them. Clinton Gormley __

Re: [Templates] Can a template discover if a block is defined?

2006-12-23 Thread Clinton Gormley
You can do a TRY block. But you must catch the error. TRY; PROCESS FOO; CATCH; ''; END; > > > > > Template 2 (bar.tt): > > [% PROCESS foo IF foo.defined # in other words if the block foo exists > %] > > > > In this case TT will not compile if the BLOCK foo doesn't exist in > foo.

Re: [Templates] Capturing the output of blocks in hash elements

2006-11-22 Thread Clinton Gormley
:) I'm six foot five. I've got that already. Now I want everything else :) > ____________ Clinton Gormley [EMAIL PROTECTED] www.TravelJury.com - For travellers, By travellers __

Re: [Templates] Capturing the output of blocks in hash elements

2006-11-22 Thread Clinton Gormley
s neater and probably a fraction more efficient. ____________ Clinton Gormley [EMAIL PROTECTED] www.TravelJury.com - For travellers, By travellers ___ templates mailing list templates@te

[Templates] Capturing the output of blocks in hash elements

2006-11-22 Thread Clinton Gormley
t = PROCESS my_block; data = { output => output, }; thanks Clint ____ Clinton Gormley [EMAIL PROTECTED] www.TravelJury.com - For travellers, By travellers ___ template

Re: [Templates] printable versions of pages

2006-11-08 Thread Clinton Gormley
> templates mailing list > templates@template-toolkit.org > http://lists.template-toolkit.org/mailman/listinfo/templates ________ Clinton Gormley [EMAIL PROTECTED] www.Trave

[Templates] Syntax highlighting for Template Toolkit in gedit

2006-09-28 Thread Clinton Gormley
Here's a syntax highlighter for gedit running in Gnome. it's not perfect, but gnu-regexes are fairly limited in comparison with what we have in Perl. Any my mime stuff is probably not the recommended way of doing it. However, it works for me (at least it does on SuSE 10.1) I have assigned a made

Re: [Templates] Turning file version checking off

2006-09-20 Thread Clinton Gormley
thread: > > http://www.template-toolkit.org/pipermail/templates/2005-July/007526.html Good thread - thank you ____ Clinton Gormley [EMAIL PROTECTED] www.TravelJury.com - For travellers, By travellers __

Re: [Templates] Turning file version checking off

2006-09-20 Thread Clinton Gormley
where to find those. ____________ Clinton Gormley [EMAIL PROTECTED] www.TravelJury.com - For travellers, By travellers ___ templates mailing list templates@template-toolkit.org http://lists.template-

Re: [Templates] Turning file version checking off

2006-09-20 Thread Clinton Gormley
code > push. > That's a good point. How did you bypass TTs file access system? Did you subclass Provider? Is the code open for others to use? thanks Clint ________ Clinton Gormley [EMAIL PROTECTED] www.TravelJury.co

[Templates] Turning file version checking off

2006-09-20 Thread Clinton Gormley
I may be barking up the wrong tree, but the way I understand it, TT does the following: - when PROCESS is called - checks if it is in the current file - if not, checks for the location of the file - checks the last modified date - if has been modified - recaches it - runs it whi