Skip to content

Instantly share code, notes, and snippets.

@paularmstrong
Created August 7, 2013 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paularmstrong/6176041 to your computer and use it in GitHub Desktop.
Save paularmstrong/6176041 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<script src="swig.pack.min.js"></script>
</head>
<body>
<script>
var ctx = {
abcdefghijklmnopqrstuvwxyz: [
{ foo: 'bar' }
]
};
swig.init({});
var tpl = swig.compile('{{ abcdefghijklmnopqrstuvwxyz[0]|json_encode }}');
console.log(tpl);
console.log(tpl(ctx))
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment