From: makoto kuwata <kwa...@gmail.com>
Date: Fri, 5 Jun 2009 20:33:01 -0700 (PDT)
Local: Fri, Jun 5 2009 11:33 pm
Subject: Re: pyTenjin Feature Requests
Hi Steve, thank you for trying pyTenjin.
On 2009-06-06 3:37, Steve <unetright.thebas...@xoxy.net> wrote:
> The indentation levels of the <?py ?> statements are mandatory to be
What I can do is to extend Template class to add dummy 'if' statement.
> separate from my indentation of the html content. Instead, I would > like to be able to use whatever indentation is appropriate for the > html as long as it is constant between <?py ?> statements. For > example: > <body>
main.py:
import tenjin
class MyTemplate(tenjin.Template):
def convert(self, input, filename=None):
def add_stmt(self, buf, code):
print(MyTemplate('ex.pyhtml').script)
ex.pyhtml:
<html>
result:
$ python main.py
This hack will work well, but notice that it changes line number
> Another problem I have is that my django templates get pre-processed
'30% reduction' is very impressive.
> with an html compressor which strips out redundant whitespace. Since > I indent my html liberally and use 4 spaces per indentation, there is > a 30% reduction with this processing. Yes I do know this is minimized > with html gzip transfer encoding. Howerver some browsers ( *cough* IE > *cough* ) have caching and etag bugs with respect to gzip'd content. Hmm, it is difficult for Tenjin to strip spaces automatically and correctly. I don't have a good solution for this issue, but I'll try to think it. --
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||