CL-WHO-like HTML templating for other languages?

前端 未结 9 1060
别那么骄傲
别那么骄傲 2020-12-10 04:44

Common Lisp guys have their CL-WHO, which makes HTML templating integrated with the \"main\" language thus making the task easier. For those who don\'t know CL-WHO, it looks

9条回答
  •  既然无缘
    2020-12-10 05:33

    There is stan: An s-expression-like syntax for expressing xml in pure python, from Divmod's Nevow. I think it's kind of what you want. An example from the tutorial linked:

    t = T.table[
               T.tr[
                   T.td[ "Name:" ],
                   T.td[ original.name ]
               ],
               T.tr[
                   T.td[ "Email:" ],
                   T.td[T.a(href='mailto:%s' % original.email)[ original.email ] ]
               ],
               T.tr[
                   T.td[ "Password:" ],
                   T.td[ "******" ]
               ],
           ]
    

提交回复
热议问题