Live data from Hacker News

I Hate Haml

ithaca.arpinum.org

21–30 of 37 posts

Re: I Hate Haml

#21

Earlier quoted context omitted.

He's explicitly asking if there's a better way to do that (read the last paragraph), so lighten up. PS - You spelled "flame-bait" wrong.

He titled it "I Hate Haml." There are better ways to ask for help. PS - Pointing out my misspelling of "flame-bait" is flame-bait.

He titled it "I Hate Haml." There are better ways to ask for help.

No doubt, except that I hate Haml. You're absolutely right that it was a quick sloppy post on my part. That said, I stand by my feelings (as personal reactions to how Haml looks and the choices it makes) and the HTML2Haml site suggested (by implication of how it converts things) that newlines was the way to do it. I absolutely didn't realize that you could include straight HTML inside Haml (and the docs don't make this overwhelmingly obvious). I now see this in the docs under "Plain Text":

> Note that HTML tags are passed through unmodified as well. If you have some HTML you don’t want to convert to Haml, or you’re converting a file line-by-line, you can just include it as-is.

But I wasn't looking in the section on "Plain Text" since I wanted marked-up text. Still, my fault for not reading the docs more carefully before ranting.

Thanks for the tip and response (to you and to everyone here). I'm updating the post now. Changes should go up in no more than an hour. Edit: Changes are live. Thanks again to all commenters.

Re: I Hate Haml

#22

Earlier quoted context omitted.

He titled it "I Hate Haml." There are better ways to ask for help. PS - Pointing out my misspelling of "flame-bait" is flame-bait.

Indeed. So hey, to make something of this discussion: Am I correct in thinking HAML is fairly closely tied to Ruby? I'm quite familiar with Markdown* , but don't use Ruby. As long as we're committing to a given language for an ersatz HTML syntax, I prefer CL-WHO ( http://weitz.de/cl-who/ ) or a similar approach in Lua, JSON, etc. Also, it doesn't look like there's cross-language support, which is a major advantage fo…

I'm not sure, I've never tried using it outside of a rails/sinatra app, but I'm pretty sure you can have it generate the proper files for whatever language you're developing in. It ends up just being html, after all. Maybe somebody else has a better answer?

Re: I Hate Haml

#23
post #3

I've wondered if haml is just a reaction to I don't like XML mindset, so we'll invent a new syntax. Personally I like SASS, since it needed hierarchy defined. But cleanly written HTML gives you that (yes, you need close tags, but I already write closing parenthesis).

I resisted haml for a long time because of this; "HTML is good enough, why change it?" and then I found out that it's really, really useful.

I'm currently dual-maintaining a theme in Wordpress and a Rails app; the former is PHP with your standard interpolated HTML, and the latter is haml. Guess which one is harder to maintain? (Hint: It's the Wordpress theme, by about three hundred miles).

Re: I Hate Haml

#25

Earlier quoted context omitted.

He titled it "I Hate Haml." There are better ways to ask for help. PS - Pointing out my misspelling of "flame-bait" is flame-bait.

Indeed. So hey, to make something of this discussion: Am I correct in thinking HAML is fairly closely tied to Ruby? I'm quite familiar with Markdown* , but don't use Ruby. As long as we're committing to a given language for an ersatz HTML syntax, I prefer CL-WHO ( http://weitz.de/cl-who/ ) or a similar approach in Lua, JSON, etc. Also, it doesn't look like there's cross-language support, which is a major advantage fo…

Yes I do believe haml is built pretty strictly to Ruby. I haven't seen or heard of anything from the project about switching out what interpreter handles interpolation ( - and = ) as well as in-line for attributes:

%div{:class => [ruby code here]}

Re: I Hate Haml

#26
post #20

In which the OP can't figure something out so they choose to flame it instead. The OP provides the following example as a irrefutable damnation of haml: %h2 Heading content %p This is just some %em emphatic text. Maybe I'll talk about %code $BASH_VERSION here. They complain about the inability to nest em and code tags on a single line. Hey OP, try this: %h2 Heading content %p This is just some emphatic text. Maybe I'…

In addition, you can use something like the markdown filter for body text. :markdown ## Heading Content This is just some *emphatic* text. Maybe I'll talk about `$BASH_VERSION` here.

As someone who uses HAML constantly:

1. :markdown doesn't accept classes, ids, or any other modifiers like %tags. This makes for some difficult fugging.

2. You cant do - ruby or = ruby under :markdown or similar.

This is terribly inconsistent and requires some stupid work arounds.

Re: I Hate Haml

#27

In which the OP can't figure something out so they choose to flame it instead. The OP provides the following example as a irrefutable damnation of haml: %h2 Heading content %p This is just some %em emphatic text. Maybe I'll talk about %code $BASH_VERSION here. They complain about the inability to nest em and code tags on a single line. Hey OP, try this: %h2 Heading content %p This is just some emphatic text. Maybe I'…

1.That's inconsistent and just blows up the page size.

2. It would be deadly easy to have inline markup. Say: %p La la %strong la % la la.

3. The whole point of using HAML is to get rid of using the annoying HTML syntax. (Remember the tagline 'Markup haiku'?

Re: I Hate Haml

#28

Earlier quoted context omitted.

He titled it "I Hate Haml." There are better ways to ask for help. PS - Pointing out my misspelling of "flame-bait" is flame-bait.

Indeed. So hey, to make something of this discussion: Am I correct in thinking HAML is fairly closely tied to Ruby? I'm quite familiar with Markdown* , but don't use Ruby. As long as we're committing to a given language for an ersatz HTML syntax, I prefer CL-WHO ( http://weitz.de/cl-who/ ) or a similar approach in Lua, JSON, etc. Also, it doesn't look like there's cross-language support, which is a major advantage fo…

Yes, HAML is directly tied to Ruby.

Although there are PHP ports out there in progress.

There is also a Ruby Discount gem, rdiscount.

Re: I Hate Haml

#29

Earlier quoted context omitted.

Indeed. So hey, to make something of this discussion: Am I correct in thinking HAML is fairly closely tied to Ruby? I'm quite familiar with Markdown* , but don't use Ruby. As long as we're committing to a given language for an ersatz HTML syntax, I prefer CL-WHO ( http://weitz.de/cl-who/ ) or a similar approach in Lua, JSON, etc. Also, it doesn't look like there's cross-language support, which is a major advantage fo…

I'm not sure, I've never tried using it outside of a rails/sinatra app, but I'm pretty sure you can have it generate the proper files for whatever language you're developing in. It ends up just being html, after all. Maybe somebody else has a better answer?

There's a command-line version, so presumably you could use it that way, but I've also only ever come across it in the Ruby world.

Re: I Hate Haml

#30
post #20

Earlier quoted context omitted.

In addition, you can use something like the markdown filter for body text. :markdown ## Heading Content This is just some *emphatic* text. Maybe I'll talk about `$BASH_VERSION` here.

As someone who uses HAML constantly: 1. :markdown doesn't accept classes, ids, or any other modifiers like %tags. This makes for some difficult fugging. 2. You cant do - ruby or = ruby under :markdown or similar. This is terribly inconsistent and requires some stupid work arounds.

1. Discount, used by both RDiscount and BlueCloth, supports limited use of classes in inline text via pseudo-protocols in link-style tags. You can also use inline HTML in markdown. I believe that the latter is what most people do.

2. You can do the equivalent of = in Haml filters by enclosing the Ruby in #{}. For example, where sign_up_path is a Ruby helper method:

    :markdown
      [Sign Up](#{sign_up_path})
Personally, in the past I've put large blocks of mostly-static content (eg, a TOS) in a erb template or partial. I now often use the markdown filter for things like help documentation in my sites.
Post reply on HN