blob: f91a3aded28bb2a2946c339d12a8ee872395fd8c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>Handlebars 中文网:轻逻辑语义化的模板引擎</title>
<meta charset="UTF-8">
<link href="static/stylesheets/application.css" media="all" rel="stylesheet" type="text/css"/>
<link href="static/stylesheets/sunburst.css" media="all" rel="stylesheet" type="text/css"/>
<link href="static/stylesheets/site.css" media="all" rel="stylesheet" type="text/css"/>
<link href="static/images/favicon.png" rel="shortcut icon" type="image/png" />
</head>
<body>
<div id="body">
<div id="header">
<a href="index.html">
<img alt="Handlebars 中文网:轻逻辑语义化的模板引擎" src="static/images/handlebars_logo.png"/>
</a>
</div>
<div id="contents">
<a href="http://www.devswag.com/collections/handlebars" id="callout">
<img alt="Buy Handlebars swag on DevSwag!" src="static/images/handlebars-devswag.png"/>
</a>
<h1><a href="http://www.handlebarsjs.org/" target="_blank">Handlebars 中文网</a></h1>
<p><a href="http://www.handlebarsjs.org" target="_blank"><img src="https://cloud.githubusercontent.com/assets/3949015/7113820/4d7c487a-e20a-11e4-9335-53552a711137.jpg"></a></p>
<p><a href="http://handlebarsjs.com/" target="_blank">handlebras</a> 官方文档的中文版</p>
<ul>
<li>中文版:<a href="http://www.handlebarsjs.org/" target="_blank">http://www.handlebarsjs.org</a></li>
<li>英文版:<a href="http://www.handlebarsjs.com/" target="_blank">http://www.handlebarsjs.com</a></li>
</ul>
<h2>直接提交 <a href="https://github.com/nimojs/handlebarsjs.org/issues" target="_blank">issues</a> 报告翻译错误</h2>
<p>打开 <a href="https://github.com/nimojs/handlebarsjs.org/issues/new" target="_blank">issues</a> ,填写翻译错误对应的 URL 地址、错误文字、正确文字,原因。</p>
<h2>使用 gulp 参与编辑</h2>
<ol>
<li>Fork 此项目</li>
<li>使用 Github Clone 到本地</li>
<li>打开命令行/终端</li>
<li>跳转至对应目录</li>
<li>命令行输入 <code>npm install</code></li>
<li>输入 <code>gulp</code> 回车</li>
<li>开始监控 <code>/post/**/*.md</code> 文件修改,当 <code>*.md</code> 文件被修改时,将自动同步 对应的 <code>/**/*.html</code> 文件。</li>
</ol>
<p>修改完成后使用 github 发送 pull requests</p>
<h3>HTML 特殊处理</h3>
<p>因为官方英文文档中夹杂着一些带 class 的 <code><div></code> 所以通过 replace 做了一个替换。</p>
<pre><code class="lang-html"><span class="hljs-comment"><!---<div class="bullet">--></span>
Handlebars 模板看起来很像 HTML ,Handlebars 表达式嵌入在 HTML 中。
</code></pre>
<pre><code class="lang-js">html = html.replace(/<span class="hljs-comment"><!---([^-]+)--></span>/g,'$1')
</code></pre>
<p>可查看 <a href="https://github.com/nimojs/handlebarsjs.org/edit/master/posts/index.html" target="_blank">/posts/index.md</a> 的源码以理解 <code><!---<tag>--></code> 的用法。</p>
<a class="issue-tracker" href="https://github.com/nimojs/handlebarsjs.org/issues">
发现翻译错误?告诉我们。
</a>
</div>
</div>
<div id="credits"></div>
<a href="http://github.com/nimojs/handlebarsjs.org/" id="github">
<img alt="Fork me on GitHub" src="static/images/forkme_right_darkblue_121621.png" />
</a>
</body>
</html>
|