Skip to content

[Feature] - Migrating to a new snippet storage system #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
technoph1le opened this issue Jan 1, 2025 · 5 comments
Closed

[Feature] - Migrating to a new snippet storage system #87

technoph1le opened this issue Jan 1, 2025 · 5 comments
Labels
enhancement New feature or request

Comments

@technoph1le
Copy link
Owner

technoph1le commented Jan 1, 2025

What feature would you like to see?

Hi everyone!

After some discussions with our contributors and maintainers, we’ve decided to move to a new snippet storage system to keep up with our growing collection of snippets.

The Problem

Our current setup of storing snippets in a JSON file is starting to cause a few problems:

  1. For Contributors: Adding snippets line by line in a JSON file is tedious (see issue [Feature] - Add snippets in markdown instead Json.  #59). We had plans to make this easier with DevTools (see Adding devtools to make it easier to create snippets #39), but even with that, the JSON format itself feels limiting.
  2. For Maintainers: Reviewing snippets has become harder as the number of snippets grows.

Our proposed solution

We’re planning to switch to a Markdown-based system. Here’s what the new structure would look like:

/snippets
  |- language
       |- category
         |- snippet1.md
         |- snippet2.md

language and category will be folders and each snippet will be in its own Markdown file.

Here’s the snippet format:

---
title: Name of the snippet
description: A short explanation of what the snippet does
tags: tag1, tag2, tag3
author: your-github-username
---

```lang
// Your code here
```

New Field: contributors

There's planned to be a new field, called contributors. This field is for recognizing anyone who improves or refines a snippet in the future. The original author will still get credit, but contributors will also be listed so everyone gets the recognition they deserve.

Read more in CONTRIBUTING.md file.

Thoughts

We believe that this system will be easier for both parties, contributors and maintainers to add, edit and review snippets.

We’d love to hear your feedback on this plan! If you’ve got suggestions or ideas, feel free to share them here. We’ll keep this issue updated as we work through the migration. 🚀

Thanks for being part of this journey and helping improve QuickSnip!

Generated by ChatGPT

@technoph1le technoph1le added the enhancement New feature or request label Jan 1, 2025
@technoph1le
Copy link
Owner Author

View the implementation in #88

@Mathys-Gasnier
Copy link
Collaborator

@psychlone77 @saminjay
We updated how snippets are added to the repo, please do not accept any changes to the .json files anymore.
I'm going to go around old PRs informing of the change

@psychlone77
Copy link
Collaborator

This feature has been implemented. #88

@Mathys-Gasnier
Copy link
Collaborator

Please do not close it for the moment, it serves as an information that we changed the storage system

@Mathys-Gasnier
Copy link
Collaborator

As everything went pretty well with the migration, and pull requests are updating to the new way of adding snippets, i will close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants