Hacker News new | ask | show | jobs
by Bockit 5236 days ago
I get that what you're trying to do is keep it syntactically correct javascript, but just in case, have you looked at HAML [1] and/or Jade[2]? Both templating languages that allow you to write HTML in that kind of way. Even less syntax than what you're writing there.

I guess you have the overhead of the template language and rendering them though still.

[1] http://haml-lang.com/

[2] http://jade-lang.com/

EDIT: Added links.

1 comments

What I'm looking for is a way to easily create single DOM nodes, not a full templating language.

HAML and Jade assume that you have static pseudo-markup defined upfront and you just fill it with data, this approach is not suitable for apps that are doing heavy DOM manipulations (e.g. SVG editor, text editor, sophisticated widget toolkit).