-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix materialize bug; fix docker; improve readme; cleanup
- Loading branch information
Showing
15 changed files
with
60 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,70 @@ | ||
# Voilà template for Materials Cloud | ||
|
||
This is the Voilà template for the Materials Cloud project. | ||
|
||
It implements the standard Materials Cloud header and CSS. | ||
|
||
The template is called `materialscloud` and can be invoked either by using the `--template=materialscloud` `voila` CLI option, setting it explicitly in a Notebook's metadata or in a Jupyter config file. | ||
See [the Voilà documentation](https://voila.readthedocs.io/en/stable/customize.html#controlling-the-nbconvert-template) on how to invoke templates for more information. | ||
# Voilà template for Materials Cloud | ||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/materialscloud-org/voila-materialscloud-template/develop?urlpath=%2Fvoila%2Frender%2Fexample-notebooks%2Fexample.ipynb) | ||
|
||
## Try it with Binder! | ||
This is the Voilà template for Materials Cloud, implements the standard header and CSS. | ||
|
||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/materialscloud-org/voila-materialscloud-template/develop?urlpath=%2Fvoila%2Frender%2Fexample-notebooks%2Fexample.ipynb) | ||
Three templates are provided: | ||
* `materialscloud-tool` - highlights the [WORK](https://www.materialscloud.org/work)/Tools section in the header/breadcrumbs. | ||
* `materialscloud-discover` - highlights the [DISCOVER](https://www.materialscloud.org/discover) section in the header/breadcrumbs. | ||
* `materialscloud-iframe` - just adds a simple "Hosted on Materials Cloud" note at the bottom. | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install voila-materialscloud-template | ||
``` | ||
|
||
## Usage | ||
This installs the templates in the correct Jupyter path (using `copy_voila_template.py`). | ||
|
||
There are two different templates for deploying Voilà at Materials Cloud website, which are "materialscloud-tool" and "materialscloud-discover". | ||
## Usage | ||
|
||
At [Materials Cloud](https://materialscloud.org), the [WORK](https://www.materialscloud.org/work) section have a collection of simulation tools and services. To deploy such applications, one need use the "materialscloud-tool" template as: | ||
The main way is to use the `voila --template` option, e.g.: | ||
|
||
```bash | ||
voila --template=materialscloud-tool example.ipynb | ||
``` | ||
Alternatively, you can write a `voila.json` file containing | ||
|
||
```json | ||
{ | ||
"VoilaConfiguration": { | ||
"template": "materialscloud-tool" | ||
}, | ||
... | ||
} | ||
``` | ||
|
||
In the [DISCOVER](https://www.materialscloud.org/discover) section, it shows curated research data with tailored visualizations. One need to use the "materialscloud-discover" template | ||
to deploy the apps. | ||
and passing its path with | ||
|
||
```bash | ||
voila --template=materialscloud-discover example.ipynb | ||
voila --Voila.config_file_paths=<...> example.ipynb | ||
``` | ||
|
||
There are also other options, see [the Voilà documentation](https://voila.readthedocs.io/en/stable/customize.html#controlling-the-nbconvert-template) for more information. | ||
|
||
## Development | ||
|
||
Option 1: | ||
|
||
```bash | ||
pip install -e .[dev] | ||
``` | ||
|
||
Note: this will copy the templates to the jupyter folder, and they need to be modified directly there or re-copied if new tests are required. | ||
|
||
Option 2: | ||
|
||
It's more convenient to use a docker container and rebuild after modification: | ||
|
||
```bash | ||
cd docker | ||
docker compose up --build | ||
``` | ||
|
||
and access via `http://localhost:8866/`. The template and other voila configuration is specified in `voila.json`. | ||
|
||
Note: maybe there is an easier setup, e.g. with live-reload or similar. | ||
|
||
## License | ||
|
||
This repository and all files in it are licensed under the [BSD license](LICENSE), copyright (c) by Voilà contributors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
FROM python:3.8 | ||
FROM python:3.9 | ||
|
||
WORKDIR /home/voila | ||
|
||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
|
||
COPY requirements_dev.txt . | ||
RUN pip install -r requirements_dev.txt | ||
|
||
EXPOSE 8866 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
invoke==2.2.0 | ||
ipywidgets==8.1.0 | ||
voila==0.5.2 | ||
jupyter-core==5.3.1 | ||
widget-periodictable==3.1.1 | ||
voila~=0.4.4 | ||
jupyter-core~=5.3.1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
invoke~=2.2 | ||
ipywidgets~=8.1 | ||
pylint~=2.17 | ||
widget-periodictable~=3.1 | ||
jupyterlab~=4.0 | ||
widget-periodictable~=4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 0 additions & 102 deletions
102
share/jupyter/voila/templates/materialscloud-discover/base.html
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
share/jupyter/voila/templates/materialscloud-discover/tree.html
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.