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 3535 git config --global user.email "action@github.com"
3636 git add public/consolidated/*
3737 git add public/icons/*
38- git commit -m "Update consolidated snippets"
38+ git diff-index --quiet HEAD || git commit -m "Update consolidated snippets"
3939 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'
7979 - Specify the language after the first set of backticks for syntax highlighting.
8080
81816 . ** 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.
8395
8496Expected file structure:
8597
Original file line number Diff line number Diff line change @@ -80,6 +80,19 @@ Expected file structure:
8080
8181> Please do ** NOT** add or edit anything in ` /public ` folder. It will be used for consolidating snippets.
8282
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+
8396For more details about adding new categories or programming languages, check out the [ CONTRIBUTING.md] ( /CONTRIBUTING.md ) file.
8497
8598## Guidelines for Contributions
Original file line number Diff line number Diff line change 1010 "format" : " prettier --write ." ,
1111 "format:check" : " prettier --check ." ,
1212 "preview" : " vite preview" ,
13- "prepare" : " husky"
13+ "prepare" : " husky" ,
14+ "snippets:check" : " node ./utils/checkSnippetFormatting.js" ,
15+ "snippets:consolidate" : " node ./utils/consolidateSnippets.js"
1416 },
1517 "dependencies" : {
1618 "framer-motion" : " ^11.15.0" ,
You can’t perform that action at this time.
0 commit comments