News for hackers. Stuff that matters.
Re:Utterly sensible HTML templating in Common Lisp by swannodette on Tuesday November 16, 2010 @03:19PM (#1911454)
I still think the new gold standard for functional and extensible HTML templating is Enlive - people should look into this before coming up with variations of the same old wheel - https://github.com/cgrand/enlive
Re:Utterly sensible HTML templating in Common Lisp by xtacy on Tuesday November 16, 2010 @03:37PM (#1911537)
I think there's a difference: Enlive is meant to manipulate the DOM using familiar CSS/jQuery like selectors. The article however, is a way to _write_ the HTML in the first place.

I've myself been using a declarative style HTML output engine that I wrote in Python. It's simple, easier, outputs correct HTML and it merges well with my workflow. I don't have to write HTML, nor JavaScript to programmatically generate what I need. It may sound naive, but I find myself comfortable indenting code in Python than write matching HTML tags. If there are errors, the Python code wouldn't run, but HTML code would still render, though it wouldn't be what I want.

Relevant: http://code.google.com/p/zen-coding/

Re:Utterly sensible HTML templating in Common Lisp by sgrove on Tuesday November 16, 2010 @03:28PM (#1911498)
Enlive is awesome, I used it while working in clojure quite a bit. I definitely prefer it, personally, to something like Clojure's hiccup (which vana-templating is very similar to). The tradeoff is that new-comers who are already familiar with front-end design are going to find it tough to transition - it's a fundamental problem: do you optimize for the newcomer, or for the experienced developer?

Enlive has a lot in common with Vekz' suggestion elsewhere in the comments, and I feel like there's some unifying theme underlying all of this, that should make it easy for newcomers, but allow experienced developers to transform the DOM programmatically.

I'm searching for it now, and I'm sure there'll be a lot of false-starts and dead-ends, but the only sure way not to get there is to not try.

Re:Utterly sensible HTML templating in Common Lisp by nomurrcy on Tuesday November 16, 2010 @03:30PM (#1911506)
I agree completely. Enlive has really blown me away.