 <p>This is a bit of a long shot, but you could investigate <a href="http://hg.codeflow.org/genshi2js/summary" rel="nofollow">genshi2js</a>. It claims to compile a subset of genshi templates into javascript functions (similar to Google's soy templates). Unfortunately it seems to be an abandoned project. The main link for it is 404, but I was able to find the mercurial repository at the link above, and it's last activity was in 2008.</p> <p>The best solution to this problem in general is to use the same template system and have both a JS and server-side implementation. (That's also the idea behind Google soy templates--java and js implementations.)</p>