Created
March 5, 2012 05:31
-
-
Save justjake/1976877 to your computer and use it in GitHub Desktop.
HTML Macros?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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