Skip to content
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

Ability to save the code within the document or as a separate file #13

Open
bcorporaal opened this issue Nov 9, 2017 · 7 comments
Open

Comments

@bcorporaal
Copy link

I would like to be able to save the code through the plugin. Currently I have to save it by copy pasting it into a text file.

@jacopocolo
Copy link
Owner

So… the plugin actually already saves your code. Or, at least, it stores your latest code. I should probably make it more clear in the UI that the code is saved.

Or are you talking about saving multiple “files”?

@bcorporaal
Copy link
Author

I was talking about multiple files. So save and load a .js file from the panel would be helpful. Then if I work on a Sketch file later I can load the right p5.js file.
Also you are right that it would be good to make it more clear that the latest code is saved. I only realized that after I closed and opened Sketch again.

@jacopocolo
Copy link
Owner

I’ll look into it. I don’t really like the idea of having to manage an extra set of files other than your Sketch files (it would create problems with systems like Abstract, in example). Maybe it's possible to store the code in the new Sketch file format.

But, yeah, good input 👍🏻

@jacopocolo
Copy link
Owner

This is NOT the solution to the issue but in the next release (coming out as soon as Sketch 48 is out) the code will be stored in the user preferences, making the code permanent across versions. The next upgrade, sadly, will wipe the “latest code” because I'm dumb and didn't think of this before.

Still not the solution to this problem, but related!

@christian-reichart
Copy link

Hey, really nice plugin. I could see myself using this in a professional environment, however it would be really nice to set yourself custom presets. Even better, if I could share those presets with my colleagues. They are not really code enthusiast, but could use some nice shortcuts like the pie chart one.

Of course I can just copy the code and send them the file, but it would be much more efficient to have a "library" of presets. Maybe even share this library with people around the world. :)

@jacopocolo
Copy link
Owner

Hi @kweamod! Thanks!

Saving and sharing snippets is something I always had in mind for this plugin.

I will look into saving — I think I can store presets across versions the same way I store the “latest code”.

Sharing is more difficult because it would require some sort of backend. I briefly investigated the idea of storing and retrieving snippets from Gist but never went far.

I have limited time to work on the plugin lately but I'll at least take a look! Thanks again for your input!

@jacopocolo
Copy link
Owner

@kweamod: with the get function + the eval function it's technically possible to run code directly from gist. Maybe the solution is to add a UI around this? It's a lot of work but it's also kind of exciting 😁

screen shot 2018-06-27 at 09 02 37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants