HAML是一种新近发布的标记语言,最近发布了1.0版。偶看到了下,确实比RHTML要来得简洁,
如下面这两段代码:
-
for
article in @articles
.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
-
%
>
你会喜欢哪种风格呢?我会毫无疑问地选择前者。你呢?
当前已经有如下Editor提供HAML支持,更新进展请关注其 Google Group
Enjoy it... ^_^
如下面这两段代码:
-
for
article in @articles
.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
-
%
>
你会喜欢哪种风格呢?我会毫无疑问地选择前者。你呢?
当前已经有如下Editor提供HAML支持,更新进展请关注其 Google Group
Enjoy it... ^_^
HAML是一种新的标记语言,以其简洁著称。与RHTML相比,HAML的语法更加精简,提高了开发效率。本文通过示例对比了两种语言的差异。
182

被折叠的 条评论
为什么被折叠?



