Skip to content

Instantly share code, notes, and snippets.

@borkdude
Created November 13, 2011 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borkdude/1362567 to your computer and use it in GitHub Desktop.
Save borkdude/1362567 to your computer and use it in GitHub Desktop.
(enlive/deftemplate usernames-table-body
"public/index.html"
[usernames]
[:tbody#tablebody :tr]
(enlive/clone-for [username usernames]
[:td]
(enlive/content username)))
;; calling it with usernames: ["Michiel","Borkent"]
;;;; html ;;;;
<html>
<head>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"/>
</head>
<body>
<div class="container">
<div class="hero-unit">
<h1>Who is not following me?</h1>
<p>Click the button below to authenticate with your Twitter account and find out who you are following but is not following you back.</p>
<a href="whosnotfollowingme" class="btn primary large">Go!</a>
</div>
<table class="zebra-striped">
<thead>
<tr>
<th>Names</th>
</tr>
</thead>
<tbody id="tablebody">
<tr>
<td>name</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
;; output
<html>
<head>
<link href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<div class="hero-unit">
<h1>Who is not following me?</h1>
<p>Click the button below to authenticate with your Twitter account and find out who you are following but is not following you back.</p>
<a class="btn primary large" href="whosnotfollowingme">Go!</a>
</div>
<table class="zebra-striped">
<thead>
<tr>
<th>Names</th>
</tr>
</thead>
<tbody id="tablebody">
<tr>
<td>Michiel</td>
</tr><tr>
<td>Borkent</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment