[Templates] Providing extra methods for filters

2003-03-08 Thread Simon Wistow
My first post to this list and it's question. Sorry. I'll try and provide more meaningful content sometime in the future :) Anyway, I've written this module http://thegestalt.org/simon/perl/Text-Chump.html (available from http://thegestalt.org/simon/perl/Text-Chump-0.8.tar.gz) and an accompany

Re: [Templates] Providing extra methods for filters

2003-03-09 Thread Simon Wistow
On Sat, Mar 08, 2003 at 01:14:06PM +, Andy Wardley said: > Yes, have the Chump plugin new() method create a Chump and return a > reference to it. Then you can all the new_type() methods, et al, > directly. > > Also have it call $content->define_filter( chump => sub { } ) to install > your '

Re: [Templates] Odd....

2004-07-01 Thread Simon Wistow
On Wed, Jun 30, 2004 at 01:03:06PM -0400, Brett Sanger said: > Regardless, the best solution I've seen yet is the Siesta Mailer > (written in Perl!) that makes it a per-user setting for the list, rather > than a per-list setting. Not that I've run into any lists using Siesta > yet. One of the rea

Re: [Templates] Pass through perl?

2004-07-16 Thread Simon Wistow
> Any other suggestions for translating a lot of random perl code into TT > without rewriting a perl interpreter? I'm not entirely sure what you means but you may want to look at the PERL and RAWPERL sections of this http://www.template-toolkit.org/docs/plain/Manual/Directives.html#Filters_Plugi

Re: [Templates] ANNOUNCE: mod_tt-0.1

2004-07-18 Thread Simon Wistow
On Fri, Jul 16, 2004 at 03:46:39PM +0100, Tom Insam said: > http://jerakeen.org/programming/mod_tt Rarr! Seriously, this is brilliant. One of the reasons why PHP is so popular is that you can just unzip a load of .php files into a directory and have a web app. This will go a long way towar

Re: [Templates] GD

2004-08-05 Thread Simon Wistow
On Thu, Aug 05, 2004 at 03:18:31PM +, Isarin Sathitruangsak said: > [Thu Aug 05 10:48:14 2004] [error] [client 172.16.140.146] malformed > header from script. Bad header=\x89PNG: tt You need to pass a content string use CGI qw/:standard/; print header("image/png"); $template->process(...);

Re: [Templates] minus operator next to number in template gives error

2004-08-20 Thread Simon Wistow
On Fri, Aug 20, 2004 at 01:27:42PM +0100, Andy Wardley said: > Mark Fowler wrote: > > I'm sure the TT3 parser will cope with this. Andy? > > It does. Any chance of a TT3 status update? Anythign we can do to help? ___ templates mailing list [EMAIL P

Re: [Templates] Creating Wiki-style Free links?

2004-09-01 Thread Simon Wistow
On Wed, Sep 01, 2004 at 09:05:19AM -0400, Jesse Sheidlower said: > I want TT to process text that has some variety of Wiki-style tag in it, > and turn this into an html link. For example, I could have links in > the style of [[123|Text to appear]], and I want this turned into > http://www.mysite.co

Re: [Templates] hashes and loops

2004-10-19 Thread Simon Wistow
On Tue, Oct 19, 2004 at 03:13:17PM -0400, Darren Chamberlain said: > You'll need to change the push to be: > > push @emails, { > from => "fred", > to => "wilma", > subj => $subj, > date => "today" > }; > > I.e., push a hashref instead of an arrayref of a hashref. That

Re: [Templates] hash.keys not working on blessed hash?

2004-12-15 Thread Simon Wistow
On Wed, Dec 15, 2004 at 12:06:51PM -0500, Thomas, Mark - BLS CTR said: > I was hoping to find a way that didn't require modifying classes. I have a > template which can be pointed at any TT source to find out what variables > are available (like a fancy Dumper output). However it descends into a ha

Re: [Templates] hash.keys not working on blessed hash?

2004-12-16 Thread Simon Wistow
On Wed, Dec 15, 2004 at 10:03:48AM -0800, C. Chad Wallace said: > return unless ref $self && $self->isa( 'HASH' ); Whoops. In my mind I wrote that but clearly my fingers disagree. ___ templates mailing list [EMAIL PROTECTED] http://lists.template-tool

Re: TT Caching (Was: Re: [Templates] TT in callback)

2005-01-05 Thread Simon Wistow
On Wed, Jan 05, 2005 at 01:07:14PM -0500, Perrin Harkins said: > No, but the COMPILE_DIR option means that at least the "compile to perl" > step will be skipped. If there was a way to store compiled perl code > and load it faster, it would be used in all kinds of modules. B::Bytecode? "This comp

Re: [Templates] List archives with TT

2005-02-01 Thread Simon Wistow
On Mon, Jan 31, 2005 at 03:04:08PM -0800, Bill Moseley said: > Can anyone suggest a list archive tool that would work well with TT? > What I'm looking for is a tool to deal with managing the archive (list > by date/author/subject/thread and previous next lists) but use TT to > dynamically generate

Re: [Templates] List archives with TT

2005-02-01 Thread Simon Wistow
On Tue, Feb 01, 2005 at 09:35:52AM +, Simon Wistow said: > wee > it's > tryign > elsuive > befroe > liberally sprinklins Apparently I was also sideswiped by the Caravan of Bad Spelling and Grammar. Tea. I d

Re: [Templates] Confusing Apache::Template error: reason: file error - error: not found

2005-05-13 Thread Simon Wistow
On Fri, May 13, 2005 at 02:45:29PM +0100, Paul Sharpe said: > Where's that extra '\n' coming from? Apache escapes its log messages unless you tell it not to as of 1.3.25 http://securitytracker.com/alerts/2003/Aug/1007557.html ___ templates mailing li

Re: [Templates] internationalization support (i18n)

2005-06-02 Thread Simon Wistow
On Wed, Jun 01, 2005 at 10:14:58PM +0200, Daniel Schmeck said: > I use the template toolkit for generating static html pages. At the > moment are all templates with german content. At Yahoo! we used a combination of run time templates and bake time internationalisation. Words or phrases to be int

Re: [Templates] Template::Plugin::Iterator

2005-11-25 Thread Simon Wistow
On Fri, Nov 25, 2005 at 01:18:37PM +0300, Vadim Kutchin said: > And I want access to loop1s count() from loop2s. From documentation I > understand - I must use Template::Plugin::Iterator, but it is not clear for > me how. > Can anybody explain? You can take a local copy of the iterator

[Templates] Capturing implicit echoes

2006-01-12 Thread Simon Wistow
I've been pondering wriitng something so that I can do [%# loads the fr.po or similar %] [% USE Language("fr") %] [%# prints "bonjour" %] [% "hello" %] [% foo = "hello" %] [%# also prints "bonjour" %] [% foo %] I seem to remember getting

Re: [Templates] Capturing implicit echoes

2006-01-12 Thread Simon Wistow
On Thu, Jan 12, 2006 at 02:13:07PM +, me said: > Any suggestions? Against all odds this 5 minute hack seems to work although I've got a horrible reason it might be working for the wrong reason. Currently it prints out HELLO HELLO wotcha HELLO BAR Now all I need to do is change the trans

Re: [Templates] Capturing implicit echoes

2006-01-18 Thread Simon Wistow
On Thu, Jan 12, 2006 at 03:44:55PM +, me said: > Now all I need to do is change the translate() function to actually > translate using gettext and then somehow get the current language from a > Template::Plugin::Translate, presumably by dicking around with $context; I now have this working. G

Re: [Templates] Capturing implicit echoes

2006-01-19 Thread Simon Wistow
On Thu, Jan 19, 2006 at 05:43:41PM +0100, Eric Cholet said: > Just an alternative, the MakeText method certainly has its own merits. Yes, it's certainly not ideal - it's far more of a quick and dirty affair. And a bit of a horrific hack - code wise. There's some ideas I'd like to steal off your

Re: [Templates] Announce: Template::Plugin::Gravatar (Feedback, code review, comments)

2006-03-20 Thread Simon Wistow
On Sun, Mar 19, 2006 at 08:28:35AM -0500, Darren Chamberlain said: > * apv <[EMAIL PROTECTED]> [2006/03/18 21:52]: > > I just put up http://search.cpan.org/dist/Template-Plugin-Gravatar/ > > > > It's my first TT plugin and I'd love anyone interested (and maybe with > > Gravatar experience though

[Templates] mod_tt - whither the enthusiasm?

2006-04-13 Thread Simon Wistow
So a long time ago Tom Insam announced mod_tt http://www.mail-archive.com/templates@template-toolkit.org/msg05721.html and lo! there was resounding silence. Which is a shame because personally I think it rocks, especially since I spent a p[ortion of last week trying to rememb

Re: [Templates] Can there be two?

2006-05-05 Thread Simon Wistow
On Fri, May 05, 2006 at 08:20:06AM -0600, Paul Seamons said: > Years went on.  I decided it would be useful to have basic IF > directive support as well as allowing for argument passed to functions > (such as [% a(b) %]).  I added these features, played around with > things, toyed with tag parsing

Re: [Templates] Can there be two?

2006-05-05 Thread Simon Wistow
On Fri, May 05, 2006 at 09:44:49AM -0600, Paul Seamons said: > Thinking about it. It would also be possible to JSON dump the optree and > make > the execute_tree be written entirely in Javascript. So, theoretically you could create a Template->JSON handler for Apache triggered on, say, .ttj fi

[Templates] Finding defined macros

2006-05-30 Thread Simon Wistow
Is there anyway, from Template::Context or anything else accessible from a Template::Plugin, to get access to defined macros? ___ templates mailing list templates@template-toolkit.org http://lists.template-toolkit.org/mailman/listinfo/templates

Re: [Templates] ical formatting filter

2006-06-01 Thread Simon Wistow
On Mon, May 29, 2006 at 06:02:49PM +0100, Nigel Metheringham said: > I've got some slightly crufty code in a site of mine that handles > generation of ical files - using TT. Just as an aside (in case you haven't already seen it), you might also want to look at Data::ICal. _

Re: [Templates] ical formatting filter

2006-06-01 Thread Simon Wistow
On Thu, Jun 01, 2006 at 11:32:51AM +0100, Nigel Metheringham said: > It looks to me as though the rules of thumb are:- > * No timezones - do everything as UTC (Z timespecs) > * Ideally no repeats. If you have them then the end date should > be set to 23:59:59 on the last date (

Re: [Templates] A bug and a suggestion OMG!

2008-01-25 Thread Simon Wistow
On Fri, Jan 25, 2008 at 09:54:19AM -0800, Sean McAfee said: > The point is that the html filter doesn't do apostrophes. The html_entity filter does though http://www.tt2.org/docs/manual/Filters.html#section_html_entity ___ templates mailing list te

Re: [Templates] Getting keys from a hash

2008-02-26 Thread Simon Wistow
On Tue, Feb 26, 2008 at 10:22:02AM +, Karl Dane said: > Now give me the keys: > [% cgihash.keys %] Might [% cgihash.keys.join("\n") %] help here? ___ templates mailing list templates@template-toolkit.org http://mail.template-toolkit.org/mailman/li

Re: [Templates] Getting keys from a hash

2008-02-26 Thread Simon Wistow
On Tue, Feb 26, 2008 at 11:00:20AM +, Karl Dane said: > 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)' Where

Re: [Templates] Getting keys from a hash

2008-02-26 Thread Simon Wistow
On Tue, Feb 26, 2008 at 10:47:15AM +, Karl Dane said: > Apparently not! Still gives me nothing... > > It's like the keys vmethod is being completely ignored. Hmm, weird. On my machine % cat foo.tt [%- cgihash = { 'a' => 1, 'b' => 2, 'c' => 3 } -%] [% cgihash.keys.join("\n") %] % tpage foo.t

Re: [Templates] Getting keys from a hash

2008-02-26 Thread Simon Wistow
On Tue, Feb 26, 2008 at 11:17:44AM +, Karl Dane said: > Right! So - there's something REALLY weird going on here... > > To answer Simon, cgihash is from perl's CGI lib: my $cgi = new CGI; my > $cgihash = $cgi->Vars; > > Shouldn't be anything odd about it. But obviously it's behaving > diffe