On Thu, Jun 11, 2015 at 10:59:42AM -0700, Jonathan Vanasco wrote:
> I use mako, and that functionality is would be called with a 'preprocessor'.
> 
> The name for the chameleon version is "expression engine" and is done by 
> writing a "custom compiler".  its in their docs under `extensions`.
> 
> I'm not sure how to integrate either with the default template language 
> support in pyramid.   you may (but probably not) need to modify the pyramid 
> library that integrates chameleon to specify your complier - most likely 
> it's just adding a config option to your ini though.
> 
> If you do this, In my experience there are a few gotchas :
> 
> 1. Make sure you're only removing html insignificant whitespace.

Which is pretty hard given that CSS can change what's
insignificant/significant.

> 2. Depending on where/how the minimization is executed, you might screw up 
> the templating language control structures/syntax.

I was thinking of tweaking chameleon.zpt.MacroProgram.visit_cdata to
skip nodes which contain only '\r\n\t '.

> After a while I just gave up this and let the webserver handle it as part 
> of gzip compression.  It ended up being the most efficient part of the 
> stack for handling that stuff.

Sigh, that may be my route as well.

-- 
Brian Sutherland

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to