File tree Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 35
35
git config --global user.email "action@github.com"
36
36
git add public/consolidated/*
37
37
git add public/icons/*
38
- git commit -m "Update consolidated snippets"
38
+ git diff-index --quiet HEAD || git commit -m "Update consolidated snippets"
39
39
git push
Original file line number Diff line number Diff line change @@ -79,7 +79,19 @@ console.log(formatDate(new Date())); // Output: '2024-12-10'
79
79
- Specify the language after the first set of backticks for syntax highlighting.
80
80
81
81
6 . ** Test your snippet:**
82
- - Ensure your code runs as expected.
82
+ - Ensure your code runs as expected. \
83
+ To test that your snippets are formatted correctly use the ` snippets:check ` script:
84
+ ```
85
+ $ npm run snippets:check
86
+ ```
87
+ It will return nothing if they are well formatted, otherwise it will tell you what the error is.
88
+
89
+ ---
90
+ To preview the snippets, you need to consolidate them, use the `snippets:consolidate` script:
91
+ ```
92
+ $ npm run snippets:consolidate
93
+ ```
94
+ It will update the snippets in the `/public` folder, making them available to the frontend.
83
95
84
96
Expected file structure:
85
97
Original file line number Diff line number Diff line change @@ -80,6 +80,19 @@ Expected file structure:
80
80
81
81
> Please do ** NOT** add or edit anything in ` /public ` folder. It will be used for consolidating snippets.
82
82
83
+ To test that your snippets are formatted correctly use the ` snippets:check ` script:
84
+ ```
85
+ $ npm run snippets:check
86
+ ```
87
+ It will return nothing if they are well formatted, otherwise it will tell you what the error is.
88
+
89
+ ---
90
+ To preview the snippets, you need to consolidate them, use the ` snippets:consolidate ` script:
91
+ ```
92
+ $ npm run snippets:consolidate
93
+ ```
94
+ It will update the snippets in the ` /public ` folder, making them available to the frontend.
95
+
83
96
For more details about adding new categories or programming languages, check out the [ CONTRIBUTING.md] ( /CONTRIBUTING.md ) file.
84
97
85
98
## Guidelines for Contributions
Original file line number Diff line number Diff line change 10
10
"format" : " prettier --write ." ,
11
11
"format:check" : " prettier --check ." ,
12
12
"preview" : " vite preview" ,
13
- "prepare" : " husky"
13
+ "prepare" : " husky" ,
14
+ "snippets:check" : " node ./utils/checkSnippetFormatting.js" ,
15
+ "snippets:consolidate" : " node ./utils/consolidateSnippets.js"
14
16
},
15
17
"dependencies" : {
16
18
"framer-motion" : " ^11.15.0" ,
You can’t perform that action at this time.
0 commit comments