<script id="tmpl" type="text/html">
#page
+h1{Emmet as a Template}
+hr
+(#nav
>(a[href="#one"]{one}+{ | }
+a[href="#two"]{two}+{ | }
+a[href="#three"]{three})
)
+(#main
>p{This is just an experiment. Not super useful.})
+hr
+#footer>h3{footer}
</script>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
hr {
border: none;
border-bottom: 1px solid #ccc;
}
a {
color: #4c7aa8;
}
document.body.innerHTML = emmet.expandAbbreviation(
document.getElementById('tmpl')
.innerHTML
.replace(/\s+\+/g,'+')
.replace(/\n/g,'')
.replace(/\s+\>/g,'>')
.replace(/\s+/g,' ')
.replace(/\$\{0\}/g,'')
).replace(/\$\{0(.*?)\}/g,'');
This Pen doesn't use any external CSS resources.