pawelmalak / snippet-box

Snippet Box is a simple self-hosted app for organizing your code snippets. It allows you to easily create, edit, browse and manage your snippets in various languages.
MIT License
978 stars 80 forks source link

Feature Request: Import from yml or json #3

Open dejanzelic opened 3 years ago

dejanzelic commented 3 years ago

I'd love to be able to version control my snippets and it's not ideal to commit the sqlite database. I'd love to be able to have all the snippets in a yml of json which gets imported on boot.

pawelmalak commented 3 years ago

You want to have snippets and their metadata stored in a text file so you can backup it easier?

dejanzelic commented 3 years ago

Less about backing up, and more that I'd like to be able to save it to a file for later use.

For example, I'd love to save a yml file of snippets in my github projects to start, stop, install etc. the project. That way when anyone wants to contribute, they would be able to run something like:

docker run -p 5000:5000 -v /path/to/data.json:/app/data.json snippet-box

And they would have the nice Snippet-box UI with all the commands ready to go. I could just add the sqlite database to each project, but It would be bad practice to commit binary files.