Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can plunker save to github?

Can I make projects on plnkr.co and save them to github? Plnkr is perfect to present javascript projects and enables instant collaborative developements. It will be very helpful if I can export from plnkr.co to github. Is this possible? then how?

like image 990
Aladdin Mhemed Avatar asked Oct 27 '13 07:10

Aladdin Mhemed


1 Answers

Apparently not.

You have similar "synchronization" requests expressed in, for instance, issue 28, which resulted in scripts like plunk_it.

The idea is to have:

  • your files in your local repo (that you can push to GitHub)
  • a way to send those same files to plunker

The author of plunker suggests those alternatives:

I can suggest to you three alternative ways of getting your code onto Plunker that may or may not better suit your workflow:

  • Create a POST payload (in the same way you do in [r26D/plunk_id]) and send that to http://plnkr.co/edit/ (or http://beta.plnkr.co if you're feeling adventurous).
    That is what is used by the AngularJS documentation (see the Edit button on: http://docs.angularjs.org/api/ng.directive:ngReadonly).
  • Sync your snippets with Gist and then use import links for your users. This would use the same mechanism as most of the current templates on Plunker.
    To use, create a form in an iframe whose post body would correspond to the Plunk schema you've already discovered and post that iframe to http://plnkr.co/edit/gist: with target="_blank | _self".
  • Create a new importer schema for directories in a Github repository. This is something I've been wanting to add but never got around do.
    The way the importers work can be seen in: https://github.com/filearts/plunker_www/blob/master/assets/js/services/importer.coffee

Now, the major caveat of all of these proposed approaches is that you would not be able to see a listing of forks from your original code. This may be something you want. In fact, there will soon (read: next few months-ish) be more information on plunk histories. Instead of a single fork_of attribute, there will be a history array or something of the sort.

Also, a second caveat is that when I deploy the discussion pane (see: http://beta.plnkr.co/sMXKW6), none of the proposed approaches would support commenting as comments would only be enabled for saved plunks.

like image 97
VonC Avatar answered Nov 06 '22 13:11

VonC