tj / haml.js

Faster Haml JavaScript implementation for nodejs
409 stars 42 forks source link

Several proposals to improve HAML.js #50

Open the-teacher opened 12 years ago

the-teacher commented 12 years ago

Hello, It's me again =)

I compared current releases Jade and Haml. I have some words to say

1) Docs My experience show me this way to use HAML.js with Express 3

[coffee markup]

haml = require 'hamljs'
cons = require 'consolidate'

app.configure ->
  app.set 'port', process.env.PORT || 3003
  app.set 'views', __dirname + '/views'

  # HAML
  app.engine 'haml', cons.haml
  app.set 'view engine', 'haml'

https://github.com/the-teacher/ExpressOnSteroids/blob/master/src/app.coffee

2)

Standart block comments doesn't work. I think, It's should looks like this

-#
  Bla Bla
  Bla Bla
  Bla Bla

or, maybe

-//
  Bla Bla
  Bla Bla
  Bla Bla

3) String Interpolation

With Jade it's work

https://github.com/the-teacher/ExpressOnSteroids/blob/master/views/jade_vs_haml/index.jade#L1

With Haml it's doesn't work =(

4) Why HAML it's great solution for many people

I made 2 identical templates

https://github.com/the-teacher/ExpressOnSteroids/blob/master/views/jade_vs_haml/index.haml

and

https://github.com/the-teacher/ExpressOnSteroids/blob/master/views/jade_vs_haml/index.jade

Just my opinion

a) So, JADE looks good. It's like ruby template engine SLIM, but better, because arguments to tags can be pass with whitespaces

good variant for my eyes and brain (It's easy to parse by human)

a(href = "https://github.com/the-teacher", title = 'the-teacher') github.com/the-teacher

vs

bad variant for my eyes

a(href="https://github.com/the-teacher", title='the-teacher') github.com/the-teacher

Thank you for this possibility!

b)

JADE looks like SLIM. And for me it's not very good. I'm dreaming about HAML style. Why? Because it's hard to separate TAGS and TEXT for me. Tags with HAML marks with % symbol, and it's good for understanding.

Just look to templates

https://github.com/the-teacher/ExpressOnSteroids/blob/master/views/jade_vs_haml/index.jade

https://github.com/the-teacher/ExpressOnSteroids/blob/master/views/jade_vs_haml/index.haml

Total

Jade it's great template engine, and I can use it without any problems, but, friends, you shouldn't to forget about maintain of HAML.It is great alternative for many peoples.

It's should be improved.

Thank you for your work!

(can be closed after reading)

tj commented 12 years ago

slim was based on jade, and jade based on haml. I use jade myself so I don't have much time to maintain haml.js but I'd like it if someone did, I can only keep up with making sure it works for express and node in general

the-teacher commented 12 years ago

ok, thank you for attention and comments. I have my personal projects and fulltime job. Unfortunately I can't help right now, maybe somebody else.

Thank you for great work, again. Good luck!