Skip to content

Commit

Permalink
Run prettier formatter and convert to LF
Browse files Browse the repository at this point in the history
  • Loading branch information
technoph1le committed Feb 6, 2025
1 parent b8b0277 commit 9924f4d
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 63 deletions.
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Closes #
<!-- If your changes affect visuals, please include screenshots. -->

<details>
<summary>Click to view screenshots</summary>
<summary>Click to view screenshots</summary>

<!-- Add your screenshots here -->
<!-- Add your screenshots here -->

</details>
</details>
2 changes: 1 addition & 1 deletion .github/workflows/check-snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Checks snippets syntax
on:
pull_request:
paths:
- 'snippets/**'
- "snippets/**"

jobs:
check-snippets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Pre-commit checks
on:
pull_request:
branches:
- '**'
- "**"

jobs:
pre-commit-checks:
Expand Down
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ No bots are allowed within the QuickSnip community without prior written permiss
#### Final Notes

This code of conduct is inspired by [FreeCodeCamp’s approach](https://www.freecodecamp.org/news/code-of-conduct), emphasizing clarity and friendliness. Let’s work together to make QuickSnip a supportive and productive space for all developers!

102 changes: 56 additions & 46 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,22 @@ tags: number,currency
- An `example` segement, containing one or more examples of use

Example in javascript:

```js
function example(x) {
return x * 2;
return x * 2;
}

// Usage:
example(5) // Returns: 10
example(5); // Returns: 10
```

If your function doesn't return anything just show how to use it. If the result of your function is too complicated to be expressed in a single comment, your snippet is probably too complex to begin with.

### Snippet boundaries

To ensure your snippet isn’t refused, consider these questions:

- **Does the standard library of my language provide an easy way of doing this ?**
- **Does that snippet not have a real, and practical use case ?**
- **Could it be split into separate parts to be better understood ?**
Expand All @@ -79,23 +81,23 @@ If any answer is yes, then your snippet will most likely get rejected.
1. **Ensure your snippet match [guidelines](#snippets-guidelines)**

2. **Navigate to the relevant folder:**
- Go to the `/snippets` folder in the root directory.
- Locate the folder for the programming language of your snippet, such as `javascript` or `python`.

- Go to the `/snippets` folder in the root directory.
- Locate the folder for the programming language of your snippet, such as `javascript` or `python`.

3. **Choose the correct category:**

- Within the language folder, find the relevant category folder for your snippet.
- If no suitable category exists, refer to [Adding a New Category](#adding-a-new-category).
- Within the language folder, find the relevant category folder for your snippet.
- If no suitable category exists, refer to [Adding a New Category](#adding-a-new-category).

4. **Create a markdown file:**

- Create a new file with a `.md` extension.
- Name the file appropriately, keeping it descriptive and concise.
- Create a new file with a `.md` extension.
- Name the file appropriately, keeping it descriptive and concise.

5. **Add your snippet:**

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

````md
---
Expand All @@ -121,39 +123,46 @@ tags: date,format
---

```js
const formatDate = (date) => date.toISOString().split('T')[0];
const formatDate = (date) => date.toISOString().split("T")[0];

// Usage:
console.log(formatDate(new Date())); // Output: '2024-12-10'
```
````

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

- Enclose your code with triple backticks (```).
- Specify the language after the first set of backticks for syntax highlighting.

7. **Test your snippet:**

- 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, start the vite server using:
```
$ npm run dev
```
It will use HMR to update the snippets in the `/public` folder, making them available to the frontend.
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, start the vite server using:
```
$ npm run dev
```
It will use HMR to update the snippets in the `/public` folder, making them available to the frontend.
Expected file structure:
```md
/snippets
|- language
|- category-name
|- your-snippet-here.md
|- language
|- category-name
|- your-snippet-here.md
```

> Please do **NOT** add or edit anything in `/public` folder. It will be used for consolidating snippets.
Expand All @@ -164,7 +173,7 @@ If you’d like to refine or improve an existing snippet:

1. **Add a `contributors` field:**

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

````md
---
Expand All @@ -182,15 +191,15 @@ Updated code here

2. **Credit all contributors:**

- If contributors already exist, add your username separated by a comma
- If contributors already exist, add your username separated by a comma

```md
contributors: contributor1, contributor2, your-github-username
```

3. **Document changes:**

- Clearly indicate what you updated and why in your pull request description.
- Clearly indicate what you updated and why in your pull request description.

> We want to make sure that original author and contributor(s) are credited for their work.
Expand All @@ -200,21 +209,21 @@ If your snippet doesn’t fit into any existing category, you can create a new o

1. **Create a new category folder:**

- In the relevant language directory, add a new folder.
- Use a lowercase name with hyphens for separation (e.g., `file-handling`).
- In the relevant language directory, add a new folder.
- Use a lowercase name with hyphens for separation (e.g., `file-handling`).

2. **Add snippets:**

- Follow the [Adding a New Snippet](#adding-a-new-snippet) instructions.
- Follow the [Adding a New Snippet](#adding-a-new-snippet) instructions.

Example structure:

```md
/snippets
|- python
|- file-handling
|- list-manipulation
|- ....
|- python
|- file-handling
|- list-manipulation
|- ....
```

### Adding a New Language
Expand All @@ -223,21 +232,21 @@ If you want to introduce a new programming language, here's how to do it:

1. **Create a language folder:**

- Add a new folder under the `snippets` directory.
- Name it after the language in lowercase (e.g., `go`, `ruby`).
- Add a new folder under the `snippets` directory.
- Name it after the language in lowercase (e.g., `go`, `ruby`).

2. **Add categories and snippets:**

- Follow the [Adding a New Snippet](#adding-a-new-snippet) and [Adding a New Category](#adding-a-new-category) guidelines.
- Follow the [Adding a New Snippet](#adding-a-new-snippet) and [Adding a New Category](#adding-a-new-category) guidelines.

4. **Include an icon:**
3. **Include an icon:**

- Add an `icon.svg` file (50x50px) in the same language folder.
- Use tools like [Resize SVG](https://www.iloveimg.com/resize-image/resize-svg) to ensure the correct size.
- Add an `icon.svg` file (50x50px) in the same language folder.
- Use tools like [Resize SVG](https://www.iloveimg.com/resize-image/resize-svg) to ensure the correct size.

5. **Double-check your work:**
4. **Double-check your work:**

- Verify that everything is structured correctly and displays as intended.
- Verify that everything is structured correctly and displays as intended.

---

Expand All @@ -252,6 +261,7 @@ $ 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 following script:

```
Expand Down
4 changes: 2 additions & 2 deletions VISION.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ QuickSnip is an open-source tool designed for developers who want to organize, s
We do **NOT** aim to be:

- a component library
- a documentation
- a documentation

## QuickSnip Roadmap

Expand Down Expand Up @@ -52,4 +52,4 @@ This roadmap outlines our current vision for QuickSnip and may evolve based on u

QuickSnip aims to become the preferred platform for developers to store, retrieve, and collaborate on code snippets.

Explore our [GitHub Releases](https://github.com/dostonnabotov/quicksnip/releases) for updates and join us on this journey.
Explore our [GitHub Releases](https://github.com/dostonnabotov/quicksnip/releases) for updates and join us on this journey.
7 changes: 1 addition & 6 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,5 @@
}
],
"dictionaries": ["workspace"],
"ignorePaths": [
"node_modules",
"dist",
"coverage",
"public"
]
"ignorePaths": ["node_modules", "dist", "coverage", "public"]
}
7 changes: 4 additions & 3 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ abbr {
margin-left: 2.25em;
}

.search-field:hover, .search-field:hover * {
.search-field:hover,
.search-field:hover * {
cursor: pointer;
}

Expand Down Expand Up @@ -445,7 +446,7 @@ abbr {
margin-left: 1.5rem;
}

.sublanguage__button{
.sublanguage__button {
margin-left: auto;
display: flex;
align-items: center;
Expand Down Expand Up @@ -615,7 +616,7 @@ abbr {
max-height: 90vh;
overflow-y: auto;
overflow-x: hidden;
padding: 0.5rem 1rem 1rem 1rem;
padding: 0.5rem 1rem 1rem 1rem;
align-content: start;
}

Expand Down

0 comments on commit 9924f4d

Please sign in to comment.