Pure python html templating using with statements
21–24 of 24 posts
Re: Pure python html templating using with statements
#22Weby 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
#23Here is a simple idea: 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())
I've been playing with a similar syntax: https://github.com/maplambda/py-htmlout/blob/master/htmlgen.... I need to provide better examples, tests and form handling. I'm finding it nice to work with.
OTOH I think I like your syntax better.
Re: Pure python html templating using with statements
#24Earlier quoted context omitted.
I've been playing with a similar syntax: https://github.com/maplambda/py-htmlout/blob/master/htmlgen.... I need to provide better examples, tests and form handling. I'm finding it nice to work with.
Looks good. My own module of this sort auto-escapes HTML special characters in strings fed to it, by default -- it looks like yours doesn't do this, at least at first glance. Is that right? OTOH I think I like your syntax better.