diff --git a/website/catalog/Catalog.vue b/website/catalog/Catalog.vue deleted file mode 100644 index 46ce7823..00000000 --- a/website/catalog/Catalog.vue +++ /dev/null @@ -1,27 +0,0 @@ - - diff --git a/website/catalog/RuleItem.vue b/website/catalog/RuleItem.vue deleted file mode 100644 index df228e85..00000000 --- a/website/catalog/RuleItem.vue +++ /dev/null @@ -1,9 +0,0 @@ - - diff --git a/website/catalog/index.md b/website/catalog/index.md index 62777dd0..d2653f02 100644 --- a/website/catalog/index.md +++ b/website/catalog/index.md @@ -4,9 +4,4 @@ Get confused what ast-grep is? This is a list of rewriting rule to inspire you! Explore the power of ast-grep with these rewriting rules that can transform your code in seconds! ----- - - - + diff --git a/website/catalog/rule-template.md b/website/catalog/rule-template.md new file mode 100644 index 00000000..adde46dc --- /dev/null +++ b/website/catalog/rule-template.md @@ -0,0 +1,50 @@ +--- +language: JavaScript # please fully spell the language +playgroundLink: '[TODO]' +command: 'sg -p [TODO] -r [TODO]' +hasFix: true +ruleType: 'pattern' # 'pattern' or 'yaml' +--- + +## Your Rule Name + +### Description + +Some Description for your rule! + + + +### Pattern + +```js +var i = 123 +``` + + +### Fix + +```js +let i = 123 +``` + + + +### YAML +```yaml +``` + +### Example + +```js +var a = 123 +``` + +### Diff + +```js +var a = 123 // [!code --] +let a = 123 // [!code ++] +``` + +### Contributed by +[Author Name](https://your-social.link)