[Web-SIG] A trivial template API counter-proposal

Ian Bicking ianb at colorstudy.com
Mon Feb 6 00:25:29 CET 2006


Phillip J. Eby wrote:
> At 03:26 PM 2/5/2006 -0600, Ian Bicking wrote:
> 
>> Even the most trivial of web applications needs templates to include
>> other templates, so the fact that this doesn't do anything to aid or
>> specify that makes the spec feel leaky.  I can indicate where the
>> template comes from initially, but all bets are off after that.
> 
> 
> As Ben has previously pointed out, systems like Myghty are going to 
> ignore your 'find_template()' because they do their own finding.  So the 
> spec will leak no matter what, until we get to the level of 
> specification called for by the "embedding" side of my proposal.  (The 
> compile/write stuff.)  And Ben and Michael have both pointed out that 
> trying to meet a spec that calls for them to change how their inner 
> find_template works would be costly.

Yes, I understand it is difficult.  I think it is possible to refactor 
Myghty in terms of find_template without loss of functionality (and 
perhaps allowing Myghty's resolution to be used with other templating 
languages) -- but I'm sure it would not be easy.

If there was some way to support find_template/find_resource for 
languages that supported it, but still make other languages useful, that 
would be fine with me.  I personally would focus on adding that support 
where I needed it, and using those templating languages that supported 
it.  Support for that functionality is more important to me than any one 
templating language.  However, I acknowledge that people will also want 
a spec they can use without changing the underlying template implementation.

We could remove find_template/find_resource, and use a load_template 
method with a stream input (and a object name for debugging output), or 
with purely a template name and not handle actual loading at all, or 
some combination of the two.  Though I have a hard time envisioning how 
that would all work together to be usable.

-- 
Ian Bicking  |  ianb at colorstudy.com  |  http://blog.ianbicking.org


More information about the Web-SIG mailing list