HAML是一种新近发布的标记语言,最近发布了1.0版。偶看到了下,确实比RHTML要来得简洁,
如下面这两段代码:
你会喜欢哪种风格呢?我会毫无疑问地选择前者。你呢?
当前已经有如下Editor提供HAML支持,更新进展请关注其 Google Group
如下面这两段代码:
-
for
article in @articles
.post
= render_partial " article " , article
= link_to_permalink article, " Read more... " if article.extended?
%p.meta = article_links article
.post
= render_partial " article " , article
= link_to_permalink article, " Read more... " if article.extended?
%p.meta = article_links article
<
%
for
article in @articles
-
%
>
< div class = " post " >
< % = render_partial " article " , article % >
< % = link_to_permalink article, " Read more... " if article.extended? % >
< p class = " meta " >< % = article_links article % ></ p >
</ div >
< % end - % >
< div class = " post " >
< % = render_partial " article " , article % >
< % = link_to_permalink article, " Read more... " if article.extended? % >
< p class = " meta " >< % = article_links article % ></ p >
</ div >
< % end - % >
你会喜欢哪种风格呢?我会毫无疑问地选择前者。你呢?
当前已经有如下Editor提供HAML支持,更新进展请关注其 Google Group
- JEdit
- Eclipse + RadRails
- TextMate
- (G)Vim
- Komodo