You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.zh-CN.md
+41-43
Original file line number
Diff line number
Diff line change
@@ -40,47 +40,47 @@ zhlint --help
40
40
41
41

42
42
43
-
#### Advanced usage
43
+
#### 高阶用法
44
44
45
-
zhlint also supports rc and ignore config files for custom rules:
45
+
zhlint 还支持 rc 和 ignore 配置文件:
46
46
47
47
```bash
48
-
# .zhlintrc by default
48
+
#默认为 .zhlintrc
49
49
zhlint --config <filepath>
50
50
51
-
# .zhlintignore by default
51
+
#默认为 .zhlintignore
52
52
zhlint --ignore <filepath>
53
53
zhlint --file-ignore <filepath>
54
54
55
-
# .zhlintcaseignore by default
55
+
#默认为 .zhlintcaseignore
56
56
zhlint --case-ignore <filepath>
57
57
58
-
# current directory by default
58
+
#默认为 current directory
59
59
zhlint --dir <path>
60
60
```
61
61
62
-
In the config file, you can write a JSON like:
62
+
在 rc 配置文件中,您可以写一个 JSON,例如:
63
63
64
64
```json
65
65
{
66
66
"preset": "default",
67
67
"rules": {
68
-
"adjustedFullWidthPunctuation": ""
68
+
"adjustedFullwidthPunctuation": ""
69
69
}
70
70
}
71
71
```
72
72
73
-
For more details, see [supported rules](#supported-rules).
73
+
关于更多细节,请参见[支持的规则](#支持的规则)。
74
74
75
-
In the file-ignore file, you can write some lines to ignore files in [.gitignore syntax](https://git-scm.com/docs/gitignore#_pattern_format):
We support lint your text content in Markdown syntax by default. For example:
223
+
我们默认支持格式化 Markdown 语法的文本内容。例如:
226
224
227
225
```js
228
226
run('自动在_中文_和**English**之间加入空格')
229
227
```
230
228
231
-
It will analyse the Markdown syntax first and extract the pure text content and do the lint job. After that the fixed pure text content could be replaced back to the raw Markdown string and returned as the output `value`in result.
Specially, we support [Hexo tags syntax](https://hexo.io/docs/tag-plugins) just because when we use Hexo to build Vue.js website, the markdown source files more or less include special tags like that so got the unpredictable result.
233
+
特别地,我们支持 [Hexo tag 语法](https://hexo.io/docs/tag-plugins)。这是因为当我们使用 Hexo 构建 Vue.js 网站时,Markdown 源文件中可能包含一些特殊的标签从而得到不可预测的格式化结果。
236
234
237
-
As a result, we additionally skip the Hexo-style tags by default. For example:
235
+
因此,我们会默认跳过 Hexo 风格的标签。例如:
238
236
239
237
```js
240
238
run('现在过滤器只能用在插入文本中 (`{% raw %}{{ }}{% endraw %}` tags)。')
241
239
```
242
240
243
241
### 设置被忽略的特例
244
242
245
-
In some real cases we have special text contents not follow the rules by reason. So we could ues `ignoredCases`option to config that. For example we'd like to keep the spaces inside a pair of brackets, which is invalid by default. Then we could write one more line of HTML comment anywhere inside the file:
243
+
在一些特殊的情况下,我们可能会有一些特殊的文本内容不遵循规则。因此,我们可以使用 `ignoredCases`选项来配置。例如,我们想要保留括号内的空格,这在默认情况下是格式不正确的。不过我们可以在文件的任何地方写一行 HTML 注释:
If you want to ignore the whole file, you can also add this HTML comment:
264
+
如果你想要忽略整个文件,你也可以添加这个 HTML 注释:
267
265
268
266
```md
269
267
<!-- zhlint disabled -->
@@ -472,6 +470,6 @@ type RuleOptions = {
472
470
}
473
471
````
474
472
475
-
## Moreinformation
473
+
## 更多信息
476
474
477
-
zhlintisnowopensourcedon[GitHub](https://github.com/zhlint-project/zhlint) and [issues](https://github.com/zhlint-project/zhlint/issues) welcome.
0 commit comments