I managed to extend templetor to support JavaScript templates.
I did this by adding a new construct `jsdef` to Templetor. It defines
a template function and also generates an equivalent JavaScript
function.
For example:
$jsdef hello(name)
Hello, $name!
$hello("world")
will generate:
<script type="text/javascript">
function hello(name){
var self = [], loop;
self.push("Hello, "); self.push(websafe(name)); self.push("!\n");
self.push("\n");
return self.join("");
}
</script>
Hello, world!
Code and readme at
http://github.com/anandology/notebook/tree/master/2010/03/jsdef/
Anand
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.