python模板引擎:Art Mustache

jopen 11年前

Art Mustache(文艺的大胡子)是一个python模板引擎,它非常简单,它被设计为一个容易学习,紧凑和富有表现力的模板引擎,使得编码更加流畅。

Art Mustache 本身不是一个新的编程语言,而是使用本地语言(就像python)的语法进行编程。

Art Mustache仅用到下面的语法标记:

* @variable

    变量生成到模板的语法,列如:@name

* @{...}

    单行或者多行块的python代码,通常用于定义变量,或者作三元表达式或一个python代码语块,列如:@{name='hello world'}

* @expression{...}

    通过表达式控制需要生成到模板的html。

* @:single string rendered in template.

   在@{...}中使用@:可以输出单行文本到模板上。

项目主页:http://www.open-open.com/lib/view/home/1352190949172