|
2 | 2 |
|
3 | 3 | **30 seconds of code** is powered by the community, so feel free to contribute in any way you can to help us! |
4 | 4 |
|
5 | | -## Tools |
6 | | - |
7 | | -Before you begin contributing, you should install the integration-tools globally on your machine: |
8 | | - |
9 | | -```sh |
10 | | -npm install -g @30-seconds/integration-tools |
11 | | -``` |
12 | | - |
13 | | -This will allow you to use our customized tools for all of our content repositories. |
14 | | - |
15 | 5 | ## How you can help |
16 | 6 |
|
17 | 7 | - Submit pull requests with new snippets (see guidelines below) or snippet updates (tags, descriptions, explanations, typos, examples, code improvements). |
18 | | -- Open issues for things you want to see added, modified, discuss ideas or help out with existing issues. |
| 8 | +- Open issues for things you want to see added, modified, discuss ideas or help out with existing issues. |
19 | 9 |
|
20 | 10 | ## Ground rules |
21 | 11 |
|
22 | 12 | Breaking any of these rules will result in your pull request being closed. Please follow these guidelines above all else: |
23 | 13 |
|
24 | 14 | - **Always be polite and respectful to others** and try to follow the advice of the moderators/collaborators/owners. |
25 | 15 | - **Only modify snippet files**, never modify the generated files in the `snippet_data` directory. |
26 | | -- **Use the integration tools commands** to generate new snippets, ensuring they have the correct name and are in the correct location. |
| 16 | +- **Use the snippet template** to create new snippets, ensure they have the correct name and are in the correct location. |
27 | 17 | - **Follow snippet format exactly**, otherwise your snippets will not be recognized correctly by the tools responsible for publishing them on the website. This includes such things as spacing and empty lines - if you accidentally make a mistake, consult the repository's [snippet template](snippet-template.md). |
28 | 18 | - **Snippets should solve real-world problems**, no matter how simple and should be abstract enough to be applied to different scenarios. |
29 | 19 |
|
30 | 20 | ## Snippet creation |
31 | 21 |
|
32 | | -After installing the integration tools, you can run the following command: |
33 | | - |
34 | | -```sh |
35 | | -create-new-snippet <my-snippet-name> |
36 | | -``` |
| 22 | +In order to create a new snippet, you should follow the steps below: |
37 | 23 |
|
38 | | -Replace `<my-snippet-name>` with the name of the snippet you are adding. |
| 24 | +- Crate a copy of the [snippet template](snippet-template.md) in the `snippets` directory. |
| 25 | +- Change the name of the newly created file to the name of your snippet. |
| 26 | +- Edit the file, adding your snippet based on the guidelines. |
39 | 27 |
|
40 | 28 | ## Snippet guidelines |
41 | 29 |
|
42 | 30 | - Snippets must have all their frontmatter sections (title, tags etc.) filled. |
43 | 31 | - Snippet titles must correspond to the filename and follow the language and repository's naming conventions. |
44 | 32 | - Snippet tags must be comma-separated, contain a primary tag as seen on the website as their first tag and an expertise tag (`beginner`, `intermediate` or `advanced`) as their last tag. |
| 33 | +- Snippets must have their `firstSeen` dates formatted using [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). |
45 | 34 | - Snippet descriptions must be short and to the point. Explain *what* the snippet does and detail *how* the snippet works and the language features used in it. |
46 | 35 | - Snippet code and examples must be enclosed in appropriate, language-tagged blocks as shown in the snippet template, be short and use modern techniques and features. Also make sure to test your code before submitting. |
47 | 36 | - If your snippet contains arguments with default parameters, explain what happens if they are omitted when calling the function and what the default case is. Specify default parameters for arguments only if necessary. |
|
0 commit comments