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

more generator options #31

Open
lee2sman opened this issue Nov 7, 2017 · 5 comments
Open

more generator options #31

lee2sman opened this issue Nov 7, 2017 · 5 comments

Comments

@lee2sman
Copy link

lee2sman commented Nov 7, 2017

I am thinking of 2 common workflow options that would be great to include.

CDN option

  • Generating just a sketch.js and index.html (and maybe style.css?) in a new directory.
  • The index could point to the P5 CDN files instead. I tend to work this way when just quickly creating little sketches.
  • Maybe a -c flag could stand for CDN. Example syntax p5 g -c SKETCHNAME

How to include additional libraries

  • I have been using the P5Play library a lot recently, and P5Geolocation
  • Would be nice to be able to include the P5play library or P5Geolocation files in a bundle for example
  • Example syntax: p5 g -b -i="P5Play" SKETCHNAME
@chiunhau
Copy link
Owner

chiunhau commented Nov 8, 2017

@lee2sman Thanks for the suggestions. I think the first one can still be discussed, while the second feature is already on the road map :D

When I need to quickly create little sketches my workflow is like:

  1. cd into the Collection folder I made long time ago (called p5-lab, which usually has many projects)
  2. p5 g something
  3. p5 s and go to localhost:5555

I always create new project in Collection, run the server and open it with Collection GUI. Therefore, they import the same p5.js libraries so don't even need CDN or generate their own p5 files. I'm not sure what your workflow like or maybe you found Collection is hard to use? So far CDN option is not a convincing and necessary option to me.

Let me know if you have any idea or I missed something :)

@lee2sman
Copy link
Author

lee2sman commented Nov 8, 2017

That makes a lot of sense after hearing your workflow. I don't use collections since I have a really different file organization structure on my computer. I have lots of locations for p5 sketches. And I often need to email or upload just a sketch.js - not a complete collection or bundle. I'm using Atom or Neovim most of the time btw.

@chiunhau
Copy link
Owner

chiunhau commented Nov 9, 2017

Ah I see. I think the feature discussed in issue #24 meets your requirements. Because your case is more advanced and customized, it should be done by Custom Template command, not by p5-manager's default command.

The custom template workflow may look like (WIP, just my imagination):

  1. Create a folder called custom_p5_template.
  2. Create a customized index.html with CDN and anything you wish in it.
  3. Along with other stuff such as sketch.js style.css p5.play.js. All depends on individuals.
  4. Then p5 template path/to/custom_p5_template --default to set the folder as default template
  5. Next time run p5 generate NEW_PROJECT you'll get a clone of that template

I hope that could cover most of your requirements (?) Please follow that issue to help us make good stuff 😄
btw I use :atom: too! Cheers 🍻

@lee2sman
Copy link
Author

lee2sman commented Nov 9, 2017

You are right! That would do it! :)

@TahsinTariq
Copy link

@chiunhau Hello! I've been using the p5 manager for a while and I like it very much. The only issue is that I couldn't set the custom_p5_template as default. Does the custom template folder have to be inside a collection folder to work?

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