Skip to content

Instantly share code, notes, and snippets.

@geelen
Created December 9, 2009 00:31
Show Gist options
  • Save geelen/252126 to your computer and use it in GitHub Desktop.
Save geelen/252126 to your computer and use it in GitHub Desktop.
case class Post(username: String, title: String, body: String)
object Main {
import Tags._
def main(args: Array[String]) {
println(render(Post("glen", "opinions", "wack.")))
}
def render(post: Post) = {
html(
head(
title(post.title)
),
body(
h1(post.title, p("foo")),
h2('class -> "us'er", post.username),
p('class -> "post", post.body),
span("span1"),
span('class -> "span2", "span2"),
span('class -> "span3", 'id -> "win", "span3"),
span('class -> "span3", 'id -> "winboat", 'style -> "lol: strong", "span3")
)
)
}
}
<html>
<head>
<title>opinions</title>
</head>
<body>
<h1>opinions
<p>foo</p>
</h1>
<h2 class='us\'er'>glen</h2>
<p class='post'>wack.</p>
<span>span1</span>
<span class='span2'>span2</span>
<span class='span3' id='win'>span3</span>
<span class='span3' style='lol: strong' id='winboat'>span3</span>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment