Skip to main content

Voilà template for Materials Cloud that implements the Materials Cloud header and CSS.

Project description

Voilà template for Materials Cloud

PyPI - Version Binder

This is the Voilà template for Materials Cloud, implements the standard header and CSS.

Three templates are provided:

  • materialscloud-tool - highlights the WORK/Tools section in the header/breadcrumbs.
  • materialscloud-discover - highlights the DISCOVER section in the header/breadcrumbs.
  • materialscloud-iframe - just adds a simple "Hosted on Materials Cloud" note at the bottom.

Installation

pip install voila-materialscloud-template

This installs the templates in the correct Jupyter path (using copy_voila_template.py).

Usage

The main way is to use the voila --template option, e.g.:

voila --template=materialscloud-tool example.ipynb

Alternatively, you can write a voila.json file containing

{
  "VoilaConfiguration": {
    "template": "materialscloud-tool"
  },
  ...
}

and passing its path with

voila --Voila.config_file_paths=<...> example.ipynb

There are also other options, see the Voilà documentation for more information.

Development

Option 1:

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:

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.

Making a new release

To release a new version, just make a new release on Github with the correct version tag, without updating any versions manually. This will start the GitHub action that will

  • update version numbers in the repo and commits it;
  • tags this new commit with the version, overwriting the tag that was made by the Github release;
  • pushes commit & tag to Github;
  • publishes new version on PYPI.

License

This repository and all files in it are licensed under the BSD license, copyright (c) by Voilà contributors.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

voila_materialscloud_template-0.4.1.tar.gz (575.7 kB view details)

Uploaded Source

File details

Details for the file voila_materialscloud_template-0.4.1.tar.gz.

File metadata

File hashes

Hashes for voila_materialscloud_template-0.4.1.tar.gz
Algorithm Hash digest
SHA256 846f43dc5e4820523e5168f953938d565de109b4f356c8cc9413e2dbec337418
MD5 ad24a7a09a545f1d3980715dde527afe
BLAKE2b-256 d3bd18af2e55293e081b0f5e65bad9e7a65b8845aa5947ef7deacfd490c8ec79

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page