Pure python html templating using with statements
gist.github.com
Pure python html templating using with statements
1–10 of 24 posts
Re: Pure python html templating using with statements
#2Re: Pure python html templating using with statements
#3It's not friendly to UI designers who like to load it into something like Dreamweaver or translate their static design into the template. I haven't thought of any good solution for that though. Zope TAL seemed like a valiant attempt but I'm sure how successful it was.
Re: Pure python html templating using with statements
#4Weby Templates are used in production on websites that have garnered over 500,000 uniques a month. They are incredibly easy to work with. They are the "templates for lazy people". They have 3 main benefits:
* easier * faster * more flexible
* The main codebase is implemented in 100 source lines of code.
* Extensive libraries only add just a couple hundred other lines of code.
* It is simple.
* It ensures that all tags have closing tags.
* It is compiled and fast.
* It is unicode compliant and safe.
* You can be fully fluent within 5 minutes since it is just Python and a transparent library.
http://www.jperla.com/blog/post/weby-templates-are-easier-fa...
Re: Pure python html templating using with statements
#5Weby Templates: http://www.jperla.com/blog/post/weby-templates-are-easier-fa... Weby Templates are used in production on websites that have garnered over 500,000 uniques a month. They are incredibly easy to work with. They are the "templates for lazy people". They have 3 main benefits: * easier * faster * more flexible * The main codebase is implemented in 100 source lines of code. * Extensive libraries only add just…
Re: Pure python html templating using with statements
#6http://davidbau.com/downloads/templet.py
And some notes about the implementation:
http://davidbau.com/archives/2007/03/11/python_string_functi...
Re: Pure python html templating using with statements
#7Weby Templates: http://www.jperla.com/blog/post/weby-templates-are-easier-fa... Weby Templates are used in production on websites that have garnered over 500,000 uniques a month. They are incredibly easy to work with. They are the "templates for lazy people". They have 3 main benefits: * easier * faster * more flexible * The main codebase is implemented in 100 source lines of code. * Extensive libraries only add just…
Thanks, I didn't find that when searching. Very similar idea, but a slightly more involved syntax. I see it uses string building rather than a lib like lxml which probably makes it faster.
Re: Pure python html templating using with statements
#8(That said, aside from Atom feeds I haven't had the need to output XML rather than JSON in a very long time)
Re: Pure python html templating using with statements
#9Earlier quoted context omitted.
Thanks, I didn't find that when searching. Very similar idea, but a slightly more involved syntax. I see it uses string building rather than a lib like lxml which probably makes it faster.
This was the thread that I needed: http://hackerne.ws/item?id=1605909
Re: Pure python html templating using with statements
#10 html(
head(
title('This is the title')),
body(
div(id='header', body=...)))
We could also create a shortcut for div ID and classes.. for instance a keyword capitalized is an ID, or something starting with _ could be a class.It could then be possible to make "custom" fields:
html( headers(), left_side(), content(), footer())