Closed arokem closed 6 years ago
Sorry - wrong link. Here: https://mybinder.org/v2/gh/arokem/AFQ-Browser-TRACULA/gh-pages
Even better, this one puts you straight in the index notebook:
https://mybinder.org/v2/gh/arokem/AFQ-Browser-TRACULA/gh-pages?filepath=index.ipynb
The question I have now is: is there any way to generate that URL from the domain name on which the site is running? Ideally, we would add a third button here: https://github.com/yeatmanlab/AFQ-Browser/blob/master/afqbrowser/site/client/index.html#L110, with the href
somehow set from the domain name. Does anyone know how to do that?
@arokem, I made a PR against this branch with some suggestions for how to do that. Todo:
save-settings.js
Thanks! Looks great.
I proposed a change to the URL on your PR: it needs to launch the gh-pages
branch.
And if we want to launch straight to the index
notebook, it should have an additional query string after that.
Hmm. Something seems amiss. See example here: https://arokem.github.io/AFQ-Browser-TRACULA-binder-button/
The button is there, but the link doesn't get properly set.
Almost there. Need to set the right URL for binder to build properly.
24487e6 is much better than my suggestion.
Do you have an updated demo site?
24487e6 is much better than my suggestion.
Do you have an updated demo site?
This site:
https://arokem.github.io/AFQ-Browser-TRACULA-binderized2
links to binder, but the link is not quite correctly formed. Still needs a tiny bit more.
Ahh, I see. It's sending us to: https://mybinder.org/v2/gh/arokem.github.io//AFQ-Browser-TRACULA-binderized2/gh-pages?filepath=index.ipynb
but it should be https://mybinder.org/v2/gh/arokem/AFQ-Browser-TRACULA-binderized2/gh-pages?filepath=index.ipynb
So perhaps, the replace line should just be
var user = uri.hostname().replace('.github.io', '');
i.e. no slash in the first argument to replace.
But wait, if there's no slash in uri.hostname()
then where is the double slash in the first address above coming from? That's weird. We could avoid this whole issue entirely by using
var user = uri.hostname().split('.')[0];
instead.
@arokem, @akeshavan Is one method better than the other?
Yup. The split approach works. Here's an example site:
This PR now has two notebooks. The first only shows how to load the data:
https://github.com/arokem/AFQ-Browser/blob/cf3d4ff2eebcc676e0085447639b2587cde44d2f/afqbrowser/site/client/index.ipynb
And points to the other one that has an example analysis:
https://github.com/arokem/AFQ-Browser/blob/cf3d4ff2eebcc676e0085447639b2587cde44d2f/afqbrowser/site/client/example-analysis.ipynb
This latter is written so that it is fairly robust to differences between data-sets. It doesn't point to any tract or statistic by name. And it does a visualization + analysis pipeline that should run on many data-sets, even if it doesn't produce anything particularly insightful. And it does the machine learning!