Starting Binderised Repos in a Particular Location

Looking at producing a couple of Binder buttons for a demo repo (ouseful-demos/choropleth-map-demo) in which I wanted to launch directly into a notebook in one case, a ScriptedForm demo in another, I noticed that there are two variants for launching into MyBinder location: ?filepath= and ?urlpath=.

Via @minrk in the Binder gitter channel:

[B]oth result in different urls when redirecting the user to the running binder.

  • urlpath is appended unmodified, so that it goes to hub.mybinder.org/user/xyz/{urlpath}
  • filepath is a location of a file in the repo, so filepath=index.ipynb gets turned into e.g. hub.mybinder.org/user/xyz/notebooks/index.ipynb to open that file.

urlpath requires knowledge of the notebook server’s url scheme, but can land you anywhere you like. filepath doesn’t require that knowledge, but can do fewer things (e.g. just open a notebook or directory).

Handy, and good to know…

 

 

Author: Tony Hirst

I'm a Senior Lecturer at The Open University, with an interest in #opendata policy and practice, as well as general web tinkering...