mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 15:38:58 +08:00
49 lines
2.2 KiB
JavaScript
49 lines
2.2 KiB
JavaScript
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/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('生成完毕')); |