2019-08-02 17:23:00 +08:00
|
|
|
const fs = require('fs');
|
|
|
|
const chalk = require('chalk');
|
|
|
|
const json = require('../packages/www/src/RULES');
|
2019-08-23 22:32:01 +08:00
|
|
|
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(' ')}
|
2019-08-02 17:23:00 +08:00
|
|
|
|
2019-08-02 17:24:15 +08:00
|
|
|
支持**图形界面** / **vscode插件**2种查询方式.
|
2019-08-02 17:23:00 +08:00
|
|
|
|
2019-10-27 13:01:46 +08:00
|
|
|
## :rocket:图形界面
|
2019-08-02 17:23:00 +08:00
|
|
|
https://any86.github.io/any-rule/
|
|
|
|
|
2019-11-20 21:58:48 +08:00
|
|
|
## 🍭vscode插件
|
2019-08-05 16:24:58 +08:00
|
|
|
1. 安装vscode中插件搜索框输入**any-rule**
|
|
|
|
2. 安装完毕后按**F1**(或者ctrl+shift+p).
|
|
|
|
3. 输入"**zz**"可以看到正则列表.
|
|
|
|
4. 或者**输入关键词**, 比如"手机".
|
2019-08-02 17:23:00 +08:00
|
|
|
|
2020-01-10 13:57:30 +08:00
|
|
|

|
2019-08-02 17:23:00 +08:00
|
|
|
|
2019-11-20 21:58:48 +08:00
|
|
|
## :fire:关于PR
|
2019-11-20 22:15:21 +08:00
|
|
|
欢迎大家PR, 步骤如下:
|
|
|
|
1. **正则**请在**packages/www/src/RULES.js**中添加.
|
|
|
|
2. 运行\`npm run test:rules\`进行测试.
|
|
|
|
3. 运行\`npm run build:md\`更新**README.md**.
|
|
|
|
4. 请务必提交到**develop**分支.
|
|
|
|
|
|
|
|
在此感谢大家对**any-rule**做出的贡献!
|
2019-10-27 13:01:46 +08:00
|
|
|
|
2020-01-10 16:20:06 +08:00
|
|
|
## 👽主要开发者
|
|
|
|
按照加入时间排序
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="https://github.com/MrTenger"><img width="60" src="https://avatars3.githubusercontent.com/u/10781715?s=60&v=4"></a>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="https://github.com/giraffeComing"><img width="60" src="https://avatars2.githubusercontent.com/u/14800669?s=460&v=4"></a>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="https://github.com/microud"><img width="60" src="https://avatars1.githubusercontent.com/u/10163257?s=60&v=4"></a>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="https://github.com/52cik"><img width="60" src="https://avatars0.githubusercontent.com/u/5033310?s=60&v=4"></a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2019-11-20 21:58:48 +08:00
|
|
|
## 🍔正则
|
2019-08-02 17:23:00 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
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');
|
2019-11-20 09:54:46 +08:00
|
|
|
console.log(chalk.green('生成完毕'));
|