Fork me on GitHub

hey guys, what is the apparent difference between Enlive and Selmer?


@vastor: Selmer is like Jinja2/Django templates, Enlive is HTML represented as Clojure vectors (`[:div [:a {:href “/“} “click me”]]`)


@jeffmk isn’t it Hiccup that is html as vectors? Haven’t looked at these for months but from memory Selmer is a templating library that does placemarker replacement in html templates and Enlive actually pattern matches on selectors and ids in static HTML files and manipulates it to produce dynamic pages.


Pragmatically it means Selmer templates need markup to indicate the dynamic elements whereas Enlive is raw HTML with no markup (unless you want it).


@agile_geek @vastor Apologies, I had just woken and not had any caffeine 😐


Looking at the github pages is useful to see context:


@jeffmk no problem. The way I think about the difference is that enlive lets designers work completely in static HTML without polluting it with markup. However, I’m not sure this is a big advantage as enlive is more sensitive to changes in Selectors/Ids that a designer would not think would have a side effect whereas markup in the HTML is explicit. Of course, enlive can do mark up too and gives a lot of flexibility to manipulate the shape of the page dynamically.


Right, it’s about as sensitive to change as a webscraper I suppose. Ideally there'd be some kind of tests to catch that sort of thing, throw an error when a selector doesn't find its target.