Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e9ee067

Browse files
Fix syntax error in guidelines
1 parent 49692f9 commit e9ee067

File tree

2 files changed

+51
-20
lines changed

2 files changed

+51
-20
lines changed

‎CONTRIBUTING.md‎

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,49 +43,51 @@ To add a new code snippet:
4343

4444
- Use the following format to structure your snippet:
4545

46-
```md
46+
````md
4747
---
4848
title: Name of the snippet
4949
description: A short explanation of what the snippet does
5050
tags: tag1, tag2, tag3
5151
author: your-github-username
5252
---
5353

54+
```lang
5455
// Your code here
5556
```
57+
````
5658

5759
Here’s an example for JavaScript:
5860

59-
```
61+
````md
6062
---
6163
title: Format Date
6264
description: Formats a date in 'YYYY-MM-DD' format.
6365
author: dostonnabotov
64-
tags: javascript,date,format,utility
66+
tags: javascript,date,format
6567
---
6668

69+
```js
6770
const formatDate = (date) => date.toISOString().split('T')[0];
6871

6972
// Usage:
7073
console.log(formatDate(new Date())); // Output: '2024年12月10日'
7174
```
75+
````
7276

7377
5. **Use syntax highlighting:**
7478
- Enclose your code with triple backticks (```).
7579
- Specify the language after the first set of backticks for syntax highlighting.
7680

77-
![snippet code example in markdown file](https://github.com/user-attachments/assets/be650cfe-fd17-49e7-ae82-e1c88e30d4c9)
78-
7981
6. **Test your snippet:**
8082
- Ensure your code runs as expected.
8183

82-
Expected structure:
84+
Expected file structure:
8385

84-
```txt
85-
snippets
86-
|- language
87-
|- category
88-
|- your-snippet-here.md
86+
```md
87+
/snippets
88+
|- language
89+
|- category-name
90+
|- your-snippet-here.md
8991
```
9092

9193
### Editing a Existing Snippet
@@ -96,7 +98,7 @@ If you’d like to refine or improve an existing snippet:
9698

9799
- Include your GitHub username under the `contributors` field in the metadata section.
98100

99-
```md
101+
````md
100102
---
101103
title: Name of the snippet
102104
description: A short explanation of what the snippet does
@@ -105,8 +107,10 @@ author: original-author
105107
contributors: your-github-username
106108
---
107109

110+
```
108111
Updated code here
109112
```
113+
````
110114

111115
2. **Credit all contributors:**
112116

@@ -141,10 +145,10 @@ Example structure:
141145

142146
```md
143147
/snippets
144-
|_ python
145-
|_ file-handling
146-
|_ list-manipulation
147-
|_ ....
148+
|- python
149+
|- file-handling
150+
|- list-manipulation
151+
|- ....
148152
```
149153

150154
### Adding a New Language

‎README.md‎

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
An open-source project that categorizes handy code snippets across various programming languages. Built with love and powered by an awesome community. 🚀
44

5-
<a href="https://youtu.be/BhRi7fJzPgk?si=z1sVXU7uRS0bkSEt" target="_blank" style="text-decoration: none;">
6-
<img src="https://img.shields.io/static/v1?label=&message=Watch%20on%20YouTube&labelColor=FFFFFF&color=FF0000&style=for-the-badge&logo=youtube&logoColor=FF0000" alt="Watch on YouTube" style="margin-right: 20px">
5+
<div>
6+
<a href="https://youtu.be/BhRi7fJzPgk?si=z1sVXU7uRS0bkSEt" target="_blank">
7+
<img src="https://img.shields.io/static/v1?label=&message=Watch%20on%20YouTube&labelColor=FFFFFF&color=FF0000&style=for-the-badge&logo=youtube&logoColor=FF0000" alt="Watch on YouTube">
78
</a>
9+
<div>
810

911
<br>
1012

@@ -36,20 +38,45 @@ The snippets database is located in the `/snippets` folder.
3638

3739
3. Create a markdown file and add your snippet using the following format:
3840

39-
```md
41+
````md
4042
---
4143
title: Name of the snippet
4244
description: A short explanation of what the snippet does
4345
tags: tag1, tag2, tag3
4446
author: your-github-username
4547
---
4648

49+
```lang
4750
// Your code here
4851
```
52+
````
4953

5054
Here's an example for JavaScript:
5155

52-
![code example in markdown file](https://github.com/user-attachments/assets/dba9fda3-76fe-4d92-b12a-8bc065286b90)
56+
````md
57+
---
58+
title: Format Date
59+
description: Formats a date in 'YYYY-MM-DD' format.
60+
author: dostonnabotov
61+
tags: javascript,date,format
62+
---
63+
64+
```js
65+
const formatDate = (date) => date.toISOString().split('T')[0];
66+
67+
// Usage:
68+
console.log(formatDate(new Date())); // Output: '2024年12月10日'
69+
```
70+
````
71+
72+
Expected file structure:
73+
74+
```md
75+
/snippets
76+
|- language
77+
|- category-name
78+
|- your-snippet-here.md
79+
```
5380

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /