Skip to content

Instantly share code, notes, and snippets.

@luiz
Created March 3, 2011 15:54
Show Gist options
  • Save luiz/852983 to your computer and use it in GitHub Desktop.
Save luiz/852983 to your computer and use it in GitHub Desktop.
VRaptor HTML DSL's current syntax
html(
head(
title("Page generated by VRaptor's HTML DSL"),
css("/css/example.css"),
js("https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"),
js("/js/example.js")
),
body(
image("/images/vraptor-logo.png", "VRaptor Logo"),
p(
a(attrs(href("#"), id("hi")), "Hi!")
),
p(
text("This page has a "),
a(attrs(href(page2)), "complex link"),
span(" to another page")
),
p(
text("To "),
a(attrs(href(list)), "a page with a list")
),
p(
text("And for "),
a(attrs(href(google)), "Google")
),
p(
text("And yet "),
a(attrs(href(dontClick)), "a link you should not click")
)
)
);
html().with(
head().with(
title().with("Page generated by VRaptor's HTML DSL"),
css("/css/example.css"),
js("https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"),
js("/js/example.js")
),
body().with(
image("/images/vraptor-logo.png", "VRaptor Logo"),
p().with(
a(href("#"), id("hi")).with(
"Hi!"
)
),
p().with(
text("This page has a "),
a(href(page2)).with("complex link"),
span().with(" to another page")
),
p().with(
text("To "),
a(href(list)).with("a page with a list")
),
p().with(
text("And for "),
a(href(google)).with("Google")
),
p().with(
text("And yet "),
a(href(dontClick)).with("a link you should not click")
)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment