Open bantya opened 5 years ago
If https://github.com/ZeroX-DG/SnippetStore/issues/46#issuecomment-466534795 is implemented before addressing this (#48) issue, then it will be a hell-lot easy to export the snippets as stated above.
I first intended the export feature is for transferring the exported snippet to other computer and import it using the import feature. I didn't make the export snippet content feature because I think people can always click the copy button.
I first intended the export feature is for transferring the exported snippet to other computer and import it using the import feature. I didn't make the export snippet content feature because I think people can always click the copy button.
Copy button is anytime useful. No doubt about that! One may have his/her e.g. utility class/library(s) that they use in almost every project. Copying the snippet content, creating a new file and then pasting into it is somewhat inconvenient.
There is a middle way which can be best of both worlds: Having a setting in (Interface section) which user can toggle to choose between the current export behavior or the newer proposed one may be a great help!
e.g.
[x] Show snippet update time
[ ] Show snippet copy count
👉 [x] Export the snippet content only (Export metadata also if unchecked)
Current Behavior
Currently the Export JSON button exports the snippet in .json format and not really in the actual snippet filetype. The expoerted snippet json does contain the actual snippet however, it also holds the metadata such as
created_date
,updated_date
,name
,tags
etc.Demonstration
This is what an exported snippet looks like:
I know it is pulled from the snippets.json file:
Expected Behavior
Upon exporting a snippet, as per https://github.com/ZeroX-DG/SnippetStore/issues/46#issuecomment-466535333, only the snippet content (withput \n, metadata) should be exported as the snippet file name along with snippet file type.
e.g. Here a snippet name is git-issue-draft.md and filetype is markdown, thus the snippet should be exported as git-issue-draft.md filename.
For multi-file snippets, user should be able to export desired files only.
System Info
References
https://github.com/ZeroX-DG/SnippetStore/issues/46#issuecomment-466534795 and https://github.com/ZeroX-DG/SnippetStore/issues/46#issuecomment-466535333