You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your snippet doesn’t fit into any existing category, you can create a new one! Just make sure it’s unique and doesn’t overlap with others (e.g., don’t create separate categories for “Date” and “Time” when “Date and Time” works).
Clearly indicate what you updated and why in your pull request description.
122
+
123
+
We want to make sure that original author and contributor(s) are credited for their work.
124
+
125
+
126
+
### Adding a New Category
127
+
128
+
If your snippet doesn’t fit into any existing category, you can create a new one! Just make sure it’s unique and doesn’t overlap with others (e.g., don’t create separate categories for “Date” and “Time” when “Date and Time” works).
129
+
130
+
1.**Create a new category folder:**
131
+
132
+
- In the relevant language directory, add a new folder.
133
+
- Use a lowercase name with hyphens for separation (e.g., `file-handling`).
112
134
113
-
Add your new language like this:
135
+
2.**Add snippets:**
114
136
115
-
```json
116
-
[
117
-
{
118
-
"lang": "Go",
119
-
"icon": "/icons/go.svg"
120
-
}
121
-
]
137
+
- Follow the [Adding a New Snippet](#adding-a-new-snippet) instructions.
138
+
139
+
140
+
Example structure:
141
+
142
+
```md
143
+
/snippets
144
+
|_ python
145
+
|_ file-handling
146
+
|_ list-manipulation
147
+
|_ ....
122
148
```
123
149
150
+
### Adding a New Language
151
+
152
+
If you want to introduce a new programming language, here's how to do it:
153
+
154
+
1.**Create a language folder:**
155
+
156
+
- Add a new folder under the `snippets` directory.
157
+
- Name it after the language in lowercase (e.g., `go`, `ruby`).
158
+
159
+
2.**Add categories and snippets:**
160
+
161
+
- Follow the [Adding a New Snippet](#adding-a-new-snippet) and [Adding a New Category](#adding-a-new-category) guidelines.
162
+
124
163
4.**Include an icon:**
125
164
126
-
Upload a logo for your language into the `/public/icons` folder. Make sure the filename matches the one you used in `_index.json`. Icons should be 50x50px in `.svg` format.
165
+
- Add an `icon.svg` file (50x50px) in the same language folder.
166
+
- Use tools like [Resize SVG](https://www.iloveimg.com/resize-image/resize-svg) to ensure the correct size.
127
167
128
168
5.**Double-check your work:**
129
169
130
-
Test on your side and confirm if it works properly.
170
+
- Verify that everything is structured correctly and displays as intended.
0 commit comments