Tempo: a tiny JSON rendering engine
twigkit.github.com
twigkit.github.com
You could add yours.
Graceful degradation is less common for JavaScript now than it used to be though. So if you want a smooth web experience, these days you just can't go without JavaScript. I personally don't think that's a horrible thing, but I guess most people who've disabled JavaScript (or use Lynx or something) would disagree.
I think that if your site has a clear-cut function, you should at least try to provide that functionality even for bare-html browsers. Doesn't matter if it looks ugly, the focus is this case is on functionality not looks.
In fact, I can't think of a site I regularly visit that doesn't work without js, except for things clearly in the category of "web apps", like canvaspaint.org, where the idea of "browsing" them doesn't even necessarily make sense. Even gmail works without js!
I also use 'links' from a terminal on occasion. It's gotten increasingly hard to use, but mostly due to layout issues rather than js, afaict.
The problematic sites are going to be the middle ground - large-ish sites with reasonably competent web developers who have higher priorities than supporting the 1% of users who have JavaScript disabled.
Thomas Fuchs has a very similar version: http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-...
And finally, I ported the template functionality from the "prototype.js" to php. https://github.com/freshteapot/php-template
Prototypejs - api of "Template" http://api.prototypejs.org/language/Template/
For example, I could conceivably see taking an existing web services API and spitting JSON results into a themeforest template.
I'm sure there's a million ways of doing it, but this at a glance seems like a quick way of making that happen.
we do the same for our server side templating when making sites, using php for controller & model code, but also arbitrary php as the template language in the view too. it seems to work well, and avoids the need to learn something new.
To compare the two, the upside is you get to feed the site JSON, which is easier to generate. The downside is the extra content load time of the script vs doing the template integration server side and caching the result.
<body>
{% js_template test %}
Here you can freely use {{}} because the surrounding tags make django ignore them.
{% endjs_template %}