jupytercalpoly/jupyterlab-code-snippets

Feature request: Save snippets with indented/pretty printed JSON

dhendry opened this issue · 0 comments

Is your feature request related to a problem? Please describe.

Snippet JSON files are serialized as a single line which makes them nearly impossible to manage via source control. When using tools like git any change results in an unusable diff since it appears 'everything' has changed and its difficult or impossible to manage conflicts

Describe the solution you'd like

When saving snippet json files to disk (or exporting), export them with indents.

I believe this is as simple as changing JSON.stringify(snippet) to JSON.stringify(snippet, null, 4) although I have not had a chance to test it:

https://github.com/jupytercalpoly/jupyterlab-code-snippets/search?q=JSON.stringify

image