Closed indefinit closed 7 years ago
I found that using Git Bash on windows was also really helpful to students. I have this wiki page from my class.
Happy to help repurpose / write-up for p5.js getting started as well.
Yes this is fantastic! I think it would be a huge help.
Sent from my mobile.
On Apr 15, 2015, at 3:23 AM, Daniel Shiffman notifications@github.com wrote:
I found that using Git Bash on windows was also really helpful to students. I have this wiki page from my class.
Happy to help repurpose / write-up for p5.js getting started as well.
— Reply to this email directly or view it on GitHub.
Hello, I'm sorry to post here but looking in the git repository I found this post. And I wonder if I could suggest some local server alternatives too, by example, PHP also supports the -S parameter on the CLI command enables a local server under an specifed address and port, as described on
http://php.net/manual/en/features.commandline.webserver.php
Just a suggestion, It could be on another issue, or maybe anybody else had better ideas already so this one could be ignored.
@juansrx I think that's a great suggestion! Different people will have different preferences or familiarity with different technologies and servers, so providing documentation for a variety of them is best.
I'm actually wondering whether the right approach here might not be to provide a "p5 starter kit," where you can pick your OS and platform and get a tailored set of instructions? I would be interested in helping to put something like that together
A starter kit sounds like a fantastic idea, especially if it's not a huge effort to create. I wonder in regards to the localhost server whether there's another cross platform option like gulp/grunt which would leverage nodejs and might give us more bang for the buck. A plus for using a build system like gulp or grunt is that it's a familiar tool for most JavaScript devs. I'm curious to hear your opinions about this though. Personally I feel in an ideal world, beginners would start with the p5js ide, and then graduate to a more intermediate dev environment. Python and php have great one-line command line options for http servers but they are kind of limited if you want to create a live reload environment amongst other things.
Sent from my mobile.
On Apr 19, 2015, at 10:30 AM, K.Adam White notifications@github.com wrote:
@juansrx I think that's a great suggestion! Different people will have different preferences or familiarity with different technologies and servers, so providing documentation for a variety of them is best.
I'm actually wondering whether the right approach here might not be to provide a "p5 starter kit," where you can pick your OS and platform and get a tailored set of instructions? I would be interested in helping to put something like that together
— Reply to this email directly or view it on GitHub.
If we're comfortable with "install node.js" be a prerequisite for windows, I can put a version of this together by mid next week. I did some research and there really aren't any standalone servers that ship with windows in a friendly way.
Anything else that we'd want in a starter kit that isn't covered by the existing getting started guide?
I haven't researched Windows web servers, but this sounded acceptable: https://github.com/cesanta/mongoose Apparently it's 40Kb, double click and running. It needs to be compiled (GPL2) or downloaded from http://cesanta.com/mongoose.shtml (I'm on Linux, so no idea about the quality).
Or tinyweb? http://en.kioskea.net/faq/2568-tinyweb-server-on-windows
I would like to suggest the Cloud9 IDE (free plan). Create a sketch, press play and you are running an Apache server with live reload. Awesome!
I've wondered about the online authoring too as the shortest path to get someone up and running. I prototyped something like http://bl.ocks.org/ that would let you put in the id of a gist and then wrap it up in html and include p5, but that might be too much overhead as well.
as for local serving, another option is via node's http-server. It is pretty quick and painless to setup on win, mac, *nix http://www.jhh.me/blog/2012/12/24/setting-up-http-server-on-windows-with-node-js/
Hello again.
I like the idea of bundling a small pre-configured server (or script if you already have one installed) to run scripts, for a "starter kit" it would handle the most elemental needs: accessing local assets, saving, making queries, etc. But I think it would also be a good idea to give a minimal set of instructions of how to set up a p5js enviroment on the widest array of options possible. Maybe this has been done and I'm repeating myself and even yourselves.
i was thinking...if processing and processingjs have their own books (or sections on books). Do you think it would be a good addition our own "mini book"?, I know the documentation is getting better and better, but a "getting started" book introducing a good set of p5 features would be appealing.
this is a great idea! @kadamwhite I think "install nodejs" is a reasonable prereq.
@juansrx there is in fact a Getting Started with p5.js book coming out this summer. I was planning to include an appendix there with this sort of information, but perhaps it makes more sense to point to a living document/page like this online that can be updated more quickly as things change.
@brysonian I'm curious about your bl.ocks-inspired prototype! I've also been imagining an online editor that would utilize gists and bypass some hurdles to Getting Started. Let's brainstorm in another thread soon!
Anyway, I like @indefinit's suggestion to add a link to the local server info from the Getting Started pages here and here. I'm not sure where to put that link, or if it's worth going more in-depth, since it isn't really part of "getting started" for most users. But I gave it a shot on the wiki page.
The local server wiki page has some good info that could be better organized. Right now, some headings are operating systems, while others are servers. I think it should be organized by OS, ordered by least-complex / easiest to install, to more advanced functionality. Something like this?
mac
linux
windows
Local servers are all well and good; but I think you need to keep this as simple as possible if you want to make it accessible to users outside a Computer Science context: editing path variables is fiddly on Windows and may be locked down on school computers. It also seems unnecessary when you can run something like XAMPP as a portable app...
Also, as @spasmsaps mentions above, there are editors that already provide a local test server at the press of a button and without the need for additional package installation, editing path variables etc. I already mentioned Brackets on the P5 forum and I'm sure there are others. Presumably something equivalent is in the P5 IDE roadmap?
@lmccart Thats great!, you are right about how convenient is to have a document to explain better how to set up p5 with a server, just like @therewasaguy suggested, it could be "tagged" according to OS/Server context. If you think it's a good idea, you could include in the appendix a very simple set of instructions for, lets say, nodejs (reading the former comments I see this could be the de-facto standard). Also, @blindfish3 is right, if you come from a CS context you may be more confident setting up a server and a simple set assets, so, a preconfigured or embedded server will help to make work faster, easier and more attractive. And we can always count with the wiki page, forums, and alike to treat more complex topics about using a server.
I've begun iterating on building a minimum-configuration node server environment here: https://github.com/kadamwhite/p5-server I'll test on Windows tonight, and add further getting-started instructions to e.g. walk users through installing Node. Thoughts welcome!
that sounds great! As mentioned in #624, maybe there is value to creating a p5 executable that runs a server and maybe generates a project template? It could be great if the server could be passed a .js file and would add the html and all that so folks could get running quickly by doing p5 myExperiment.js
I think this page has sufficient information for now. There's been no activity on this issue for over a year so I'm going to close it. Thanks all.
Posting this idea as a potential documentation PR - (since it came up in a recent class). For most Linux or Mac beginners, getting started with
python -m SimpleHTTPServer
to create an httpserver on localhost is relatively trivial. On windows, things are a little more complicated. I found this Stack overflow post to be helpful in regards to path environment variables setup: http://stackoverflow.com/questions/4621255/how-do-i-run-a-python-program-in-the-command-prompt-in-windows-7The most salient tip in the SO article is: Exact steps for adding Python to the path (on Windows 7): Computer->System Properties ->Advanced System Settings Click the Environment variables... button Edit PATH and append ;C:\Python27\ to the end (substitute your Python version) Click OK. Note that changes to the PATH are only reflected in command prompts opened after the change took place. Exact steps for adding Python to the path (on Windows 8):
Search for "Control Panel" and open it. Navigate from the Control Panel to System -> Advanced system settings Click the Environment variables... button Edit PATH and append ;C:\Python27\ to the end (substitute your Python version). Do not forget the trailing . Click OK. Note that changes to the PATH are only reflected in command prompts opened after the change took place.
Is this something we should add to the getting started docs? Users looking to play with p5.Sound are going to need an http server of some flavor so the python module is an easy option.