processing / p5.js-editor

Deprecated desktop editor for p5.js
https://p5js.org
MIT License
338 stars 91 forks source link

api library offline #223

Open kusha-b-k opened 8 years ago

kusha-b-k commented 8 years ago

include the api library to the editor for quick reference.

lmccart commented 8 years ago

Can you explain a little more about this one? I'm not sure I understand quite what you mean. Thanks.

kusha-b-k commented 8 years ago

In the editor, under menu bar help option an reference option is there if u click on that it will goto the p5.js website. instead of that, try to provide api reference option and it should show the all p5.js api details in the offline mode..

thanks...

bmoren commented 8 years ago

I'd like to second this, especially because it's the way the processing editor has handled it. I may have some time to work on it slowly this month and more dedicated early next month. @lmccart , I might need to pick your brain about the way the documentation is compiled on the current website with the yuidocs (can you point me in any direction to start investigating this). I do a ton of coding offline and this would be immensely helpful for those situations. At the moment, I always get a local version of the website up and running with php -S localhost:8000 which requires manually changing the p5, jquery, backbone and underscore references.

lmccart commented 8 years ago

hi @bmoren, @limzykenneth has actual been working on an offline reference build to be packaged with the p5.js download, and we could also package it with the editor. (see https://github.com/processing/p5.js/issues/1378) if you have any other thoughts or want to help on this effort feel free to jump in there! let me know if you have questions, happy to chime in with help as well.

regarding the documentation build, this section describes the current process. the key immediately helpful bit may be grunt yui:dev will build you a version of the docs with links to local copies of the JS libs, so you don't have to manually update everything.

limzykenneth commented 8 years ago

@bmoren Thanks for the interest! As @lmccart mentioned, I have a proof of concept at the moment and if you like to help out that would be great. You can start with going through the issue thread @lmccart posted since there's some decisions about the structures of the offline docs being made there.

A general shout out to everyone else as well, I'm currently building my degree show so I'm probably not gonna have time to work on that for at least a couple weeks but if someone file a PR at the repo here I can review it and merge it.

Currently two things need to be done:

  1. I had the docs currently as a nw.js package, as discussed, that is not preferable and it should just be a case of just double clicking index.html to launch the docs.
  2. Since the docs won't be running through a local server, data.json needs to be loaded in some other way (it's loaded in via ajax call at the moment).
bmoren commented 8 years ago

I'm working on implementing the current offline docs into the editor over at https://github.com/bmoren/p5.js-editor

things done: gulp task to get the compiled offline reference from the p5js website and unzip it. menu item for offline docs.

issues: @lmccart / @limzykenneth perhaps you have experience with this from working on the editor in other ways, I really don't have much experience with nwjs. I'm looking to get the path to the documentation so that it can be loaded up via the menu command. I put the documentation into public/mode_assets/p5 figuring this to be the best place. Any thoughts on the best way to get the path to that file to launch in browser which works cross platform? eg. on mac, we need to navigate to local/path/to/p5.app/Contents/Resources/nw.app/mode_assets/p5/p5-reference/index.html

I was considering startServer() in p5-mode.js to be a potential way around this, but as outlined above, its likely better to just run this as a 'double click' index kind of situation.

limzykenneth commented 8 years ago

@bmoren I'm not that familiar with nwjs as well, I would need some time to get properly familiar with it so not much help from me on the implementation I'm afraid. Having said that, in terms of how it works we can look at Processing:

screen shot 2016-07-31 at 5 17 12 pm

There's a menu item call Reference in there (which p5 editor have as well) and clicking on it opens the online reference in the browser. Since nwjs is already running an instance of Chromium itself, we can instead of opening the online reference in the browser, open the offline reference in a new window.

bmoren commented 8 years ago

@limzykenneth good idea, I have a version of this working in a new nwjs window now at my fork! If possible can someone verify the build and then release (I'm headed to a remote island for a week and I wont be able to release until I get back, hence the need for offline docs!)

I think that the offline reference is rendering a little awkward with the * logo but this is maybe a larger question for @lmccart on how the reference should load/look for the live version on the website and the offline docs too.

screen shot 2016-07-31 at 12 27 18 pm

Another style question up for discussion is weather or not to get rid of the online documentation in favor of the offline. Currently I left support for both.

screen shot 2016-07-31 at 12 39 18 pm
lmccart commented 8 years ago

awesome, thanks @bmoren! do you want to go ahead and submit a PR and I'll pull down the changes from there, test, and merge if it all works?