nbinteract icon indicating copy to clipboard operation
nbinteract copied to clipboard

Github Gists are already Supported!

Open ELC opened this issue 6 years ago • 0 comments

I was experimenting a bit and it isn't necessary to create a Github Repo, instead, one can create a Github Gist and use it.

To achieve this, follow this format in the nbinteract.json file:

{
    "spec": "{username}/{gist ID}/master",
    "provider": "gist"
}

The only problem is that using "provider" in the json file doesn't update the provider in the HTML. So in the HTML instead of having

var interact = new window.NbInteract({
      spec: '{username}/{repo}/master',
      baseUrl: 'https://mybinder.org',
      provider: 'gh',
    })

The code generated should be:

var interact = new window.NbInteract({
      spec: '{username}/{gist ID}/master',
      baseUrl: 'https://mybinder.org',
      provider: 'gist',  <- Read from nbinteract.json
    })

I've already tested changing the value in the HTML manually and it works without problems. I think that changing the code to perform this shouldn't be much complicated but until it's done, the manual change works.

I find this method much more practical since one shouldn't want to create a separate repo for each notebook or more convoluted alternatives (such as having unrelated notebooks in a common repo to achieve the same)

ELC avatar Jan 25 '19 01:01 ELC