Re: [Repoze-dev] Chameleon: a few newby questions

2011-03-29 Thread Malthe Borch
On 29 March 2011 11:02, Hanno Schlichting  wrote:
> Isn't that exactly what macros give you via define and use?

Except macros are funny in that they render implicitly where defined.

But you could definitely have a template that includes any number of
macros. Just make sure to not render that template directly then !

\malthe
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Chameleon: a few newby questions

2011-03-29 Thread Hanno Schlichting
On Tue, Mar 29, 2011 at 10:09 AM, Malthe Borch  wrote:
>> 3) Can we have >1 template per file?
>
> You want to have them "named" somehow then? What sort of syntax are
> you thinking about it?

Isn't that exactly what macros give you via define and use?

Hanno
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Chameleon: a few newby questions

2011-03-29 Thread Chris McDonough
On Tue, 2011-03-29 at 10:09 +0200, Malthe Borch wrote:
> > 
> >
> > [snip]
> >
> > Is there any shorter way to do this? Can the template loader be passed
> > implicitly?
> 
> It would easy to include a load function or even expression, i.e.
> "load: ../header.pt", but as that example illustrates, it would be
> relative to where the template itself is located.
> 
> We could include something like that. Anyone else with an opinion on this?

If the loader is off by default (meaning no magic name injected into
expression contexts by default) and the loader implementation is
pluggable, I'm +1.  If it's not off by default and not pluggable, I'd be
-1.  Rationale: it'll be hard to explain if it's on by default and uses
a Chameleon-internal loader implementation, when the rest of the system
(e.g. Pyramid/Plone) uses its own loading system.

> > 2) Repeat and macro expansion don't seem to respect indentation levels.
> > Are there any options for pretty formatting of html output? I guess I'll
> > have to parse then reformat in a separate phase?
> 
> Repeat clauses should have indentation, computed as the whitespace on
> the line of element definition.
> 
> The macro implementation does not take indentation into account. That
> might be a bug. I don't know the performance impact of having to go
> through the items in the output queue and add the indentation to each.
> Might not be bad.
> 
> > 3) Can we have >1 template per file?
> 
> You want to have them "named" somehow then? What sort of syntax are
> you thinking about it?
> 
> \malthe
> ___
> Repoze-dev mailing list
> Repoze-dev@lists.repoze.org
> http://lists.repoze.org/listinfo/repoze-dev
> 


___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Chameleon: a few newby questions

2011-03-29 Thread Malthe Borch
> 
>
> [snip]
>
> Is there any shorter way to do this? Can the template loader be passed
> implicitly?

It would easy to include a load function or even expression, i.e.
"load: ../header.pt", but as that example illustrates, it would be
relative to where the template itself is located.

We could include something like that. Anyone else with an opinion on this?

> 2) Repeat and macro expansion don't seem to respect indentation levels.
> Are there any options for pretty formatting of html output? I guess I'll
> have to parse then reformat in a separate phase?

Repeat clauses should have indentation, computed as the whitespace on
the line of element definition.

The macro implementation does not take indentation into account. That
might be a bug. I don't know the performance impact of having to go
through the items in the output queue and add the indentation to each.
Might not be bad.

> 3) Can we have >1 template per file?

You want to have them "named" somehow then? What sort of syntax are
you thinking about it?

\malthe
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev