使用 JavaScript能使本网站更好的工作。
首页
探索
帮助
登录
jan
/
mustache.js
镜像自地址
https://github.com/janl/mustache.js
关注
1
点赞
0
派生
0
代码
工单
0
版本发布
46
百科
动态
您最多选择25个主题
主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
635
提交
19
分支
8.1MB
分支:
greenkeeper-pin
8-as-legacy
master
remove-build-output-from-git
0.4.x
browser-tests-on-8
fix_commonjs
gh-pages
greenkeeper-chai-3.4.0
greenkeeper-chai-4.0.0
greenkeeper-chai-4.0.1
greenkeeper-eslint-1.5.1
greenkeeper-mocha-2.3.3
greenkeeper-mocha-3.3.0
greenkeeper-mocha-3.4.0
greenkeeper-pin
helpers
new-build-system
parser-rewrite
with-js-extras
v4.2.0
v4.1.0
v4.0.1
v4.0.0
v3.2.1
v3.2.0
v3.1.0
v3.0.3
v3.0.2
v3.0.1
v3.0.0
v2.3.2
v2.3.1
v2.3.0
v2.2.1
v2.2.0
v2.1.3
v2.1.2
v2.1.1
v2.1.0
v2.0.0
v1.2.0
v1.1.0
v1.0.0
0.8.2
0.8.1
0.8.0
0.7.3
0.7.2
0.7.1
0.7.0
0.6.0
0.5.2
0.5.2-vsc
0.5.1
0.5.1-vsc
0.5.0-vsc
0.4.2
0.4.1
0.4.0
0.3.0
0.2.3
0.2.2
0.2.1
0.2
0.1
分支列表
标签列表
${ item.name }
创建分支
${ searchTerm }
从 'greenkeeper-pin'
${ noResults }
mustache.js
/
test
/
_files
/
reuse_of_enumerables.js
reuse_of_enumerables.js
76B
原始文件
永久链接
普通视图
文件历史
Another rewrite - Cleaner separation of responsibilities in the code between scanning, parsing, compiling, and rendering functions. - Much faster
14 年前
Updated the render_segment to allow for the same variable to be reused for multiple template segments. Added a map function that can be used if not available on array natively - ahem IE ahem
16 年前
Parser rewrite This commit is a complete rewrite of the core mustache.js file with two main goals: 1) a major performance boost and 2) better compliance with the mustache spec. In order to improve performance templates are pre-compiled to JavaScript functions. These compiled functions take a view, a partials object, and an optional callback as arguments. They are cached to prevent unnecessary re-compilation of an already compiled template. Both of these enhancements facilitate a generous boost in performance. A few other notes: - The mustache.js file is now both browser and CommonJS ready without any modification. - The API exposes two main methods: Mustache.compile and Mustache.render. The former is used to generate a function for a given template, while the latter is a higher-level function that is used to compile and render a template in one shot. Mustache.to_html is still available for backwards compatibility. - The concept of pragmas is removed to conform more closely to the original mustache spec. The dot symbol still works to reference the current item in an array. - The parser is much more strict about whitespace than it was before. The rule is simple: if a line contains only a non-variable tag (i.e. not {{tag}} or {{{tag}}}) and whitespace, that line is ignored in the output. Users may use the "space" option when compiling templates to preserve every whitespace character in the original template. - The parser is able to provide detailed information about where errors occur when parsing and rendering templates, including the line number and surrounding code context.
14 年前
Updated the render_segment to allow for the same variable to be reused for multiple template segments. Added a map function that can be used if not available on array natively - ahem IE ahem
16 年前
Another rewrite - Cleaner separation of responsibilities in the code between scanning, parsing, compiling, and rendering functions. - Much faster
14 年前
1
2
3
4
5
6
({
terms: [
{name: 't1', index: 0},
{name: 't2', index: 1}
]
})