Typo 4.1 试用 HAML 作渲染

    技术2022-05-11  73

    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 JEditEclipse + RadRailsTextMate(G)VimKomodo Enjoy it... ^_^ 

    最新回复(0)