Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/consolidate-snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ jobs:
git config --global user.email "action@github.com"
git add public/consolidated/*
git add public/icons/*
git commit -m "Update consolidated snippets"
git diff-index --quiet HEAD || git commit -m "Update consolidated snippets"
git push
14 changes: 13 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,19 @@ console.log(formatDate(new Date())); // Output: '2024-12-10'
- Specify the language after the first set of backticks for syntax highlighting.

6. **Test your snippet:**
- Ensure your code runs as expected.
- Ensure your code runs as expected. \
To test that your snippets are formatted correctly use the `snippets:check` script:
```
$ npm run snippets:check
```
It will return nothing if they are well formatted, otherwise it will tell you what the error is.

---
To preview the snippets, you need to consolidate them, use the `snippets:consolidate` script:
```
$ npm run snippets:consolidate
```
It will update the snippets in the `/public` folder, making them available to the frontend.

Expected file structure:

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ Expected file structure:

> Please do **NOT** add or edit anything in `/public` folder. It will be used for consolidating snippets.

To test that your snippets are formatted correctly use the `snippets:check` script:
```
$ npm run snippets:check
```
It will return nothing if they are well formatted, otherwise it will tell you what the error is.

---
To preview the snippets, you need to consolidate them, use the `snippets:consolidate` script:
```
$ npm run snippets:consolidate
```
It will update the snippets in the `/public` folder, making them available to the frontend.

For more details about adding new categories or programming languages, check out the [CONTRIBUTING.md](/CONTRIBUTING.md) file.

## Guidelines for Contributions
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"format": "prettier --write .",
"format:check": "prettier --check .",
"preview": "vite preview",
"prepare": "husky"
"prepare": "husky",
"snippets:check": "node ./utils/checkSnippetFormatting.js",
"snippets:consolidate": "node ./utils/consolidateSnippets.js"
},
"dependencies": {
"framer-motion": "^11.15.0",
Expand Down