forked from any86/any-rule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmd.js
49 lines (34 loc) · 1.91 KB
/
md.js
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
const fs = require('fs');
const chalk = require('chalk');
const json = require('../packages/www/src/RULES');
const VSC_URL = 'https://marketplace.visualstudio.com/items?itemName=russell.any-rule'
const badges = [
// ``,
``,
`[](https://marketplace.visualstudio.com/items?itemName=russell.any-rule)`,
`[](https://marketplace.visualstudio.com/items?itemName=russell.any-rule)`,
`[](https://marketplace.visualstudio.com/items?itemName=russell.any-rule)`,
``,
`[](https://circleci.com/gh/any86/any-rule)`
];
let content = `# 正则大全 ${badges.join(' ')}
支持**图形界面** / **vscode插件**2种查询方式.
## :rocket:图形界面
https://any86.github.io/any-rule/
## vscode插件
1. 安装vscode中插件搜索框输入**any-rule**
2. 安装完毕后按**F1**(或者ctrl+shift+p).
3. 输入"**zz**"可以看到正则列表.
4. 或者**输入关键词**, 比如"手机".

## 关于PR
欢迎大家PR, 提交**正则**请在**packages/www/src/RULES.js**中添加, **README.md**无需修改, 我合并后会通过脚本自动更新文档. 在此感谢大家对**any-rule**做出的贡献!
## 正则
`;
json.forEach(({title, rule})=>{
content+= `\r\n### ${title}\r\n`;
content+= `\`\`\`javascript\r\n`;
content+= `${rule}\r\n\`\`\`\r\n`;
});
fs.writeFileSync('./README.md',content,'utf-8');
console.log(chalk.green('生成完毕'));