Skip to content

Instantly share code, notes, and snippets.

@AstraLuma
Created May 14, 2012 21:20
Show Gist options
  • Save AstraLuma/2697200 to your computer and use it in GitHub Desktop.
Save AstraLuma/2697200 to your computer and use it in GitHub Desktop.
My Templating Format
<?xml version="1.1" ?>
<?js
var foo;
console.log("Hello");
?>
<js:root xmlns:js="http://astro73.com/xml/grue/js">
<foo js:if="bar">
Hi.
</foo>
<!-- Stick more content here -->
<![CDATA[ Some more stuff goes here ]]>
</js:root>
(function(_) {var foo;
console.log("Hello");})(_);
(function(_) {
(function(_) {
_.setAttributeNS('TODO', "js:if", "bar");
_.appendChild(document.createTextNode("\n\t\tHi.\n\t"));
})(_.appendChild(document.createElement(foo)));
_.appendChild(document.createTextNode(" Some more stuff goes her "));
})(_.appendChild(document.createElementNS("http://astro73.com/xml/grue/js", "root")));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment