mustache模板引擎

时间:2015-06-13 23:09:09   收藏:0   阅读:311

Logic-less templates.

githubhttp://mustache.github.com/ 
文档:http://mustache.github.com/mustache.5.html 

http://mustache.github.io

Java 版 Mustache SVN 源码 
http://jmustache.googlecode.com/svn   

mustache 类似  freemark和valicity 模板引擎,不过mustache 更轻量级,支持语言: RubyJavaScriptPython,Erlangnode.jsPHPPerlPerl6Objective-CJavaC#/.NETAndroidC++GoLua,oocActionScriptColdFusionScalaClojure,FantomCoffeeScriptDHaskellXQuery,ASPIoDartHaxeDelphiRacketRust,OCamlSwift, and for Bash

 mustache 支持功能比较弱,不过我们可以建立在mustache 之上进行扩展实现。

mustache的特点就是很语法很简单,主要语法如下

Template:

{{#person?}}
  Hi {{name}}!
{{/person?}}

Hash:

{
  "person?": { "name": "Jon" }
}

Output:

Hi Jon!

Template:

{{#repo}}
  <b>{{name}}</b>
{{/repo}}
{{^repo}}
  No repos :(
{{/repo}}

Hash:

{
  "repo": []
}

Output:

No repos :(


原文:http://blog.csdn.net/kevin_luan/article/details/46485561

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!