Re:I Hate Haml
by krainboltgreene on Tuesday November 16, 2010 @05:40PM
(#1912021)
The :markdown "symbol" doesn't take a class.
:markdown.red#item2
%list:markdown.red#item2
%list.red#item2:markdown
...Forgive me if I'm misunderstanding your point, but :markdown isn't a tag that gets output to html, it just designates the beginning of the block to be processed with markdown, so classes and ids aren't applicable. If you want the markdown block in a class or id, you just do this:
#id.class
:markdown
[A link](/path)
outputs: <div id="id" class="class">
<a href="/path">A link</a>
</div>
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:
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.