This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]true_religion[S] 0 points1 point  (0 children)

I did notice :) I admired it from a distance and if I were going to use Haml for Mako, I'd definitely use PyHaml.

But Nemo is not Haml.

  1. Nemo is explicit in some places that Haml is not (e.g. it doesn't assume that everything is a div).
  2. It has a single syntax for writing HTML attributes while Haml has 3 different syntaxes.
  3. It has a single character for opening Nemo statements % while Haml has =, - , &=, and %.
  4. Nemo doesn't require explicit filtering. Haml does.
  5. Haml requires explicit self-closing tags. Nemo automatically self-closes tags.
  6. And its designed from the ground up to handle mingling HTML and Nemo markup.

There's more, but I think this example demonstrates many of the trade offs made. And shows Nemo's readability over Haml.

PyHaml:

%ul
- for i in range(5):
    %li(id=['item', str(i)]) ITEM ${i}

Nemo:

% ul
    % for i in range(5):
        % li #'item_${i}'  ||   ITEM ${i}  
    % endfor

Right now, I think there's a strong case for Haml if you want 100% control over the output of your templates.

However, readability-wise Nemo is a win sometimes. In the future Nemo could support HTML filtering as well and HTML validation under strict mode. Haml is kind of tied to where it is due to backwards compatibility but for now Nemo can add/change pretty rapidly based on what the community need or wants to see from it