

Slice: A Clojure library for writing composable slices of html, css, and js - zitterbewegung
https://github.com/scottjad/slice

======
KirinDave
As cool as these sorts of libraries are (and this _is_ a really elegant
library), I think their utility is limited in the kind of development that
constitutes a product.

A team can hope that they have a crack clojure developer who's also an ace
designer who's also very good at handling cross-browser rendering issues...
but that team could also hope for a magical site-building unicorn with about
as much plausibility.

I've always felt that libraries like Slice excessively couple the
application's source code with its design; even an embedded-script template
like ERb or PHP is arguably better when your markup may need to be worked over
with odd tweaks to get IE support.

Besides, Clojure already has a fantastic HTML rendering library in cgrand's
work: Enlive. It lets you take existing, valid templates and then inject new
data into them, and even compose the results. This is one of the best ways to
work on projects where the folks doing the server-side work have different
responsibilities than the client-side team, and is most amenable to designer
talent.

This approach has started to catch on elsewhere. I think the most recent place
I saw it crop up was in David Pollak's Lift project, where they're called
"Designer-Friendly Templates" (and they're even more composable there than in
Enlive).

~~~
jorgeortiz85
Lift's templates predate Clojure, let alone Enlive.

~~~
timclark
Lift templates may predate Clojure and Enlive but the designer friendly
variation are a recent development.

The designer friendly templates from still appear to need some markup added to
the HTML - the lift:surround and other tags. Enlive will let you leave the
HTML completely untouched - I'd prefer to use Enlive for that reason, most of
my work get arranged by the customer so that I get buckets of HTML produced by
external suppliers and modified throughout the project delivery.

~~~
KirinDave
I think that there are no longer any required non-html tags in Lift, as of
2.2's final release. The surround stuff goes in as a fake CSS class now, which
is a fairly unobtrusive way to do it.

