https://github.com/cgrand/enlive
For example, the code generating the page you're looking at right now
is:
(deftemplate page-template *page*
[{:keys [title blurb body]}]
[:title] (maybe-content title)
[:#page_title] (maybe-content title)
[:#about :p] (maybe-content blurb)
[:#buttons] (content (map button-model *buttons*))
[:#page_content] (content body))
And the HTML looks like:
<div id="buttons">
<a class="button" href="/"><span>Projects</span></a>
<a class="button" href="/"><span>Blog</span></a>
<a class="button" href="/"><span>Github</span></a>
</div>
<div id="page_content">
<h2 class="post_title">The Title</h2>
<div class="post_timestamp">posting time</div>
<div class="post_body">
</div>
</div>
Compare those two chunks of code and think CSS. Enlive is letting me
pick out chunks of the HTML using something that looks very much like
a CSS selector,
[:#page_content] (content body)
and then replace its content with something else and re-insert it into
the document.
As another neat example, here's the snippet of Clojure that's
formatting each post itself:
(def *post-sel* [:#page_content])
(defsnippet post-model *page* *post-sel*
[{:keys [title timestamp body] :or {:timestamp ""}}]
[:.post_timestamp] (content timestamp)
[:.post_title] (content title)
[:.post_body] (html-content body))
This extracts just the portion of the page matched by "#pagecontent"
and replaces the timestamp, title, and body using its parameters.
Enough of that. If you want to know more, check out the very excellent
enlive-tutorial.
https://github.com/swannodette/enlive-tutorial/
This was virtually 100% of my reference material for Enlive while
building this site.