Skip to content

Commit 7d1dda8

Browse files
authored
Merge pull request #239 from fcollonval/ft/add-voila-exple
Add voila example
2 parents d1822ff + 8ddd10f commit 7d1dda8

File tree

3 files changed

+48
-4
lines changed

3 files changed

+48
-4
lines changed

doc/doc-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ PyGitHub
1010
git+https://github.com/pandas-dev/pydata-sphinx-theme
1111
sphinxext-rediraffe
1212
sphinx-autobuild
13+
tqdm

doc/examples/generate_sample_repos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# These are the repositories we'll display. Break them down by topic since the list is getting long
3131
repos = {'Managing languages': ['requirements', 'conda', 'setup.py', 'julia-python', 'demo-julia', 'r', 'binder-r-description', 'octave'],
32-
'User interfaces': ['jupyterlab', 'jupyter-extension', 'jupyter-rise', 'appmode', 'bokeh', 'stencila-py'],
32+
'User interfaces': ['jupyterlab', 'jupyter-extension', 'jupyter-rise', 'voila', 'appmode', 'bokeh', 'stencila-py'],
3333
'System environments': ['python2_runtime', 'python2_with_3', 'latex', 'apt_install', 'multi-language-demo', 'python-conda_pip'],
3434
'Data and reproducibility': ['remote_storage', 'data-quilt', 'nix'],
3535
'Dockerfile environments': ['minimal-dockerfile', 'jupyter-stacks', 'rocker']}

doc/examples/sample_repos.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ python.ipynb
132132
This is a demo of Julia functionality for the Binder project. Simply
133133
go to the URL below and it will launch an interactive Julia environment:
134134

135-
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/binder-examples/demo-julia/master?filepath=demo.ipynb) | [![](https://img.shields.io/github/forks/binder-examples/demo-julia?label=GitHub%20Repo&style=social)](https://github.com/binder-examples/demo-julia)
136-
135+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/binder-examples/demo-julia/HEAD?filepath=demo.ipynb) | [![](https://img.shields.io/github/forks/binder-examples/demo-julia?label=GitHub%20Repo&style=social)](https://github.com/binder-examples/demo-julia)
137136

138137
#### Files in this repository
139138
```
@@ -152,7 +151,9 @@ RShiny: [![Binder](http://mybinder.org/badge_logo.svg)](http://mybinder.org/v2/g
152151
Binder supports using R and RStudio, with libraries pinned to a specific
153152
snapshot on [MRAN](https://mran.microsoft.com/documents/rro/reproducibility).
154153

155-
**Note:** An alternative is to use the [holepunch package for R](https://karthik.github.io/holepunch/articles/getting_started.html).
154+
**Note:** We recommend to follow [r-conda](https://github.com/binder-examples/r-conda) instead. Especially if you want to use a specific version of R or need faster build times.
155+
156+
**Note:** Another alternative is to use the [holepunch package for R](https://karthik.github.io/holepunch/articles/getting_started.html).
156157

157158
##### Requirements and suggestions
158159

@@ -358,6 +359,48 @@ presentation will automatically begin.
358359
See the [RISE Documentation](https://damianavila.github.io/RISE/)
359360
for more information.
360361

362+
#### Files in this repository
363+
```
364+
environment.yml
365+
index.ipynb
366+
```
367+
### Interactive dashboard from notebook with Voilà
368+
369+
| Voilà | JupyterLab |
370+
| :-----------------------: | :---------------------: |
371+
| [![voila-binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/binder-examples/voila/HEAD?urlpath=voila%2Frender%2Findex.ipynb)| [![jupyterlab-binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/binder-examples/voila/HEAD?urlpath=lab%2Ftree%2Findex.ipynb) |
372+
373+
This example demonstrates how to use [Voilà](https://github.com/voila-dashboards/voila) on Binder.
374+
375+
![screenshot](https://user-images.githubusercontent.com/591645/132238479-9af8dff6-ea12-465f-bb7c-2570defcdd26.png)
376+
377+
#### Configuration
378+
379+
If you would like to use the same configuration as this repository but for another project, check out the following steps:
380+
381+
1. Make sure the repository is publicly available (on GitHub, Gitlab or as a [GitHub Gist](https://gist.github.com)
382+
2. Define the dependencies in [`environment.yml`](./environment.yml). `requirements.txt` is also supported. In the dependency file, add `voila`.
383+
3. Go to [mybinder.org](https://mybinder.org) and enter the URL of the repository.
384+
4. In `Path to a notebook file`, select `URL` and use the Voilà endpoint: `voila/render/path/to/notebook.ipynb`
385+
5. Click `Launch`.
386+
6. Binder will trigger a new build if this is the first launch (or if there have been new changes since
387+
the last build). This might take a few minutes to complete. If an image is already available,
388+
the server will be able to start within a few seconds.
389+
390+
Here is an overview of the Binder configuration on [mybinder.org](https://mybinder.org):
391+
392+
![image](https://user-images.githubusercontent.com/591645/132292481-01f877c3-77f8-46ba-b265-23bd3e25f513.png)
393+
394+
For more details, check out the Voilà documentation on https://voila.readthedocs.io/en/latest/deploy.html#deployment-on-binder
395+
396+
#### JupyterLab Preview Extension for Voilà
397+
398+
The JupyterLab Preview Extension for Voilà should normally be automatically available, since Binder now defaults to JupyterLab 3.0.
399+
400+
For consistency, you can add `jupyterlab=3` as a dependency in `environment.yml`.
401+
402+
![lab-preview](https://user-images.githubusercontent.com/591645/132293167-88c22f5a-e9a7-4e26-badb-09e094d2191e.png)
403+
361404
#### Files in this repository
362405
```
363406
environment.yml

0 commit comments

Comments
 (0)