I'm trying to create a range selector, and can't seem to get off the ground.
I'm trying things like:
(sniptest "<div><p class='start'>Hi</p><p class='end'>There</p></div>"
[{[:.start] [:.end]}] (content "Hello"))
And that just returns the supplied html. I'd expect it to return a div with the body "Hello".
How do I do this?
EDIT
Just to be more concise, this is what I've done with deftemplate and a real html file:
HTML
<html>
<head>
<title></title>
</head>
<body>
<h1>Not hello</h1>
<div class="start">
foo
</div>
<div class="end">
bar
</div>
</body>
</html>
CLJ
(ns compojure-blog-test.views.landing-page
(:require [net.cgrand.enlive-html :as html]))
(html/deftemplate landing-page "compojure_blog_test/views/landing_page.html"
[blogs]
{[:.start] [:.end]} (html/content "Blah blah"))
I'm following along with this tutorial, but it uses a snippet to match ranges. Is this neccesary?
Is it possible to test these out with just sniptest
?