Hacker News new | ask | show | jobs
jQuery meets Markaby (mlanza.github.com)
14 points by mlanza 5128 days ago
This is for those who prefer to write markup with code, not templates. It's not the first implementation of this sort, but it is the latest.
4 comments

This is great. There is definitely some friction getting templates into javascript without some sort of compilation step like the Rails asset pipeline.

I'm doing a trigger.io app where I know I'll just want a few simple templates and I don't really want to add anything to the build process right now. This might be perfect.

Shameless plug:

I've been working on the exact same thing. It works with nodejs out of the box. It's still in beta, but being actively developed.

http://mcleopold.github.com/JavascriptHtmlr/

Someday I'll make it a jquery plugin as well...

No worries. There are lots of flavors. I was just looking to scratch an itch. :)
You'd be surprised how may projects exist that are like this. But somehow template languages are always more popular and have more traction. I guess there are very few people who would rather have code produce markup than have markup allow code. Perhaps because large projects have their markup written by non-coders?
> You'd be surprised how may projects exist that are like this

Yes there are a lot of these Builder libraries/modules available in many languages:

* http://stackoverflow.com/questions/671572/cl-who-like-html-t...

* http://builder.rubyforge.org/

* http://groovy.codehaus.org/Builders

* http://erector.rubyforge.org/

I prefer building in Markaby style. When I used to maintain a Radiant CMS site I'd sometimes need to generate content that I couldn't generate with the native tags. I'd end up having to teach Radius how to do something new. This interfered with "getting things done." Code doesn't get in your way.

Don't get me wrong. Markup/templating languages are great for 80% of what you use them for. And I especially like that they sandbox the average user from doing anything dangerous. I just felt like in the 20% scenarios, tweaking the markup language was a painful hoop through which to jump.

Please note: there is another open source project named "buildr": http://buildr.apache.org/. It's a rake-based build tool for Java projects.
Ugh. Thanks. For now, let's just say we're under a different namespace.
How's the performance of this versus a templating system like _.template or handlebars?

When you draw many elements on a page or are constantly redrawing elements with updated data, how does it perform?