Skip to content

Instantly share code, notes, and snippets.

@justjake
Created March 5, 2012 05:31
Show Gist options
  • Save justjake/1976877 to your computer and use it in GitHub Desktop.
Save justjake/1976877 to your computer and use it in GitHub Desktop.
HTML Macros?
-- DSL language syntax --
/* example syntax: python-like */
doctype 5
html
head
title My Awesome Page
body
div
id: global
p
"here is the text contents of a paragraph, explicitly"
p and a second paragraph here, on the samel line as the tag
SmallFocus
location: http://example.com/image.jpg
text: DERP DERP DERP
/* define new macro */
def SmallFocus
a
href: {{location}}
img
src: {{location}}
alt: {{text}}
h3 {{text}}
-- outputted HTML --
<!DOCTYPE html>
<html>
<head>
<title>My Awesome Page</title>
</head>
<body>
<div id="global">
<p>
here is the text contents of a paragraph, explicitly
</p>
<p>and a second paragraph here, on the samel line as the tag</p>
<a href="http://example.com/image.jpg">
<img src="http://example.com/image.jpg" alt="DERP DERP DERP" />
<h3>DERP DERP DERP</h3>
</a>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment