Question

I'm looking for a javascript 'port' of haml supporting the following features:

  1. Templates stored in files.
  2. JSON input.
  3. Supports "collections" [{Booking},{Booking},{Booking}] for iterated processing.

Essentially I'd like the functionality as sinatra_more's templates.

Does anyone know of something that fits the bill?

Was it helpful?

Solution

This is an old post, but just in case anyone gets here from google, it's worth mentioning Jade

It's not strict haml, but a haml-inspired templating language for node and javascript

OTHER TIPS

The most up-to-date list of Haml implementations is on the Wikipedia page. According to that, the only Javascript implementation of Haml is haml-js. I'm not sure how well this satisfies your requirements, but it's worth checking out.

Why not use the HAML library on the backend to precompile your javascript-containing HAML templates to EJS?

I'll keep you posted if I implement this & release a gem or something. I hope other kind developers will do the same if it proves too much for me. :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top