

Throw out your templates (Use pure Python instead) - mnemonik
http://bitbucket.org/tavisrudd/throw-out-your-templates/src/tip/throw_out_your_templates.py

======
ibejoeb
Okay. I like that it's intelligently argued. It's just too much, though. I
can't really ask even a talented web designer to do this:

    
    
      HTML5Doc(
            body(onload='func_with_esc_args(1, "bar")')[
                div['Escaped chars: ', '< ', u'>', '&'],
                script(type='text/javascript')[
                     'var lt_not_escaped = (1 < 2);',
                     '\nvar escaped_cdata_close = "]]>";',
                     '\nvar unescaped_ampersand = "&";'
                    ],
                Comment('''
                not escaped "< & >"
                escaped: "-->"
                '''),
                div['some encoded bytes and the equivalent unicode:',
                    '你好', unicode('你好', 'utf-8')],
                safe_unicode('<b>My surrounding b tags are not escaped</b>'),
                ]))

~~~
Luyt
That's a kind of convoluted test case. The article also contains some more
practical every-day examples.

------
stevenwei
Sorry, all of the provided examples are damn near unreadable.

And what happens when you want to make use of template inheritance and block
replacement?

------
mnemonik
The manifesto is in the module's doc string. I met Tavis at Django Ski and he
is a very cool guy!

