Nebari JupyterHub theme
Project description
Information | Links |
---|---|
Project | |
Community | |
CI |
Custom Nebari JupyterHub template
This repository contains a custom JupyterHub template for Nebari. This template overrides the default JupyterHub templates in https://github.com/jupyterhub/jupyterhub/tree/main/share/jupyterhub/templates.
For more details on JupyterHub templates and how they can be used check the official JupyterHub documentation.
Development ๐ฉ๐ปโ๐ป
Prerequisites
-
Python >= 3.8
-
We use Hatch for development and publishing of the Nebari JupyterHub theme.
We recommend you install hatch through pipx as it modifies the Python environment in which this is installed (for more details, see the Hatch documentation)
pipx install hatch
-
hatch-conda plugin. To install:
pipx install hatch-conda
Setting your development environment
-
Make a fork of the Nebari JupyterHub theme repository on your personal GitHub account.
-
Clone this repository to your local computer:
git clone https://github.com/<your-username>/nebari-jupyterhub-theme.git
-
From the root of the project, create a new development environment with hatch:
hatch env create
This will create a new development environment with all the dependencies needed for development. It will also install
nebari_jupyterhub_theme
in development mode. You can verify that your development environment is correctly set up by running the following command:$ hatch env show Standalone โโโโโโโโโโโณโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโ โ Name โ Type โ Dependencies โ Scripts โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ default โ virtual โ โ โ โโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโค โ dev โ virtual โ configurable-http-proxy โ render โ โ โ โ jupyterhub โ โ โ โ โ jupyterlab โ โ โ โ โ nodejs โ โ โโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโ
-
Initialize a new shell within the development environment:
hatch --env dev shell
To leave the environment you can type
exit
on your terminal. -
Initialize a JupyterHub instance for development:
hatch run dev:render
This command will start JupyterHub with the
--config
option pointing totest_jupyterhub_config.py
. You should be able to head to http://127.0.0.1:8081 on your web browser and see the JupyterHub instance running. -
You can now modify the templates and the
style.css
file and see the changes reflected in the JupyterHub instance without having to restart the server.
Note The values specified in
c.JupyterHub.template_vars
will overwrite the default values set innebari_jupyterhub_theme/templates
The release process for this package is documented in RELEASE.md
.
Using nebari_jupyterhub_theme
on your JupyterHub instance ๐ฆ
-
Install
nebari_jupyterhub_theme
:pip install nebari_jupyterhub_theme
Note If you already have a JupyterHub configuration file you can jump to the next step. Otherwise, follow the instructions in the JupyterHub documentation to generate a configuration file first.
-
Add the following to you JupyterHub configuration file to pick up the new
jinja2
templates directory and static files:from nebari_jupyterhub_theme import theme_extra_handlers, theme_template_paths c.JupyterHub.extra_handlers = theme_extra_handlers c.JupyterHub.template_paths = theme_template_paths
-
Optional - if you need to further customize the UI you can modify the
template_vars
within your JupyterHub config file by adding the following lines to it:# minimal configuration example overwriting the default values in the nebari_jupyterhub_theme c.JupyterHub.template_vars = { "hub_title": "Welcome to Nebari", "logo": "/hub/custom/images/Nebari-logo-square.svg", "primary_color": "#cb39ed", "secondary_color": "#2bd1c5",
The available configuration variables are:
hub_title
: The title of the JupyterHub instance. This will be displayed in the header of the login page. (H1 heading,default: Welcome to Nebari
)hub_subtitle
: Subtitle shown under the main instance Title. (H2 heading,default: ""
)welcome
: Welcome message on the login page (default: Welcome to Nebari. For more information about Nebari, visit <a href="https://nebari.dev/">https://nebari.dev</a>
)logo
: Logo displayed on the navbar (default: Nebari logomark
)primary_color
: Primary color (default: #cb39ed
)secondary_color
: Secondary color (default: #2bd1c5
)accent_color
: Accent color (default: #eda61d
)text_color
: Text color (default: #1c1d26
)h1_color
: H1 color, main Title in login page (default: #0f1015
)h2_color
: H2 color, subtitle in login page (default: #0f1015
)navbar_text_color
: Navbar links and text color (default: #1c1d26
)navbar_hover_color
: Hover color for navbar links (default: #00a3b0
)display_version
: Display the JupyterHub version in the footer (default: False
)
Note The default colors, typefaces and logos are chosen based on the Nebari branding. You can find more about this on the Nebari design repository.
:computer: You can see an example of these variables and the configuration in test_jupyterhub_config.py
.
Nebari internal options:
cdsdashboards_enabled
: This requires cdsdashboards to be present in the JupyterHub environment (default: False
)cdsdashboards_restricted
: This requires cdsdashboards to be present in the JupyterHub environment (default: False
)nebari_theme_extra_js_urls
Architecture ๐
This repository is structured as follows:
- .github: GitHub Actions configuration files and repository templates
- images: Images used in this README
- nebari_jupyterhub_theme: Python package containing the
jinja2
templates and static files - pyproject.toml: Python project configuration file
- test_jupyterhub_config.py: Example JupyterHub configuration file - used by
hatch run dev:render
to start a local JupyterHub instance for local development. - RELEASE.md: Release process documentation
Contributing to nebari-nebari_jupyterhub_theme
๐ฉโ๐ป
Thinking about contributing? Check out our Contribution Guidelines to get started.
Code of Conduct ๐
To guarantee a welcoming and friendly community, we require all community members to follow our Code of Conduct.
License ๐
nebari-nebari_jupyterhub_theme
is licensed under the BSD-3 OSI licenses.
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
Built Distribution
File details
Details for the file nebari_jupyterhub_theme-2022.10.1.tar.gz
.
File metadata
- Download URL: nebari_jupyterhub_theme-2022.10.1.tar.gz
- Upload date:
- Size: 211.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b1772f7892edac7402dea70c50e0e8f505b0ed5fb93de987842b1c0c1d4255c |
|
MD5 | 4410f1a78682ee8d519d5c0c53e9b2f6 |
|
BLAKE2b-256 | 0b29489bee1af05c7566e4e6dd970b5c56097919e57d04385db3e32eaf6255fe |
File details
Details for the file nebari_jupyterhub_theme-2022.10.1-py3-none-any.whl
.
File metadata
- Download URL: nebari_jupyterhub_theme-2022.10.1-py3-none-any.whl
- Upload date:
- Size: 213.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2de8ad8fb31d978eface75155c506f08fb20a6780b5f66f0b342ca6676fbb19 |
|
MD5 | e45e087154358bc510ef8097be9bf48e |
|
BLAKE2b-256 | 66944d285ba1eb76001f8b7cbe342fcbbc7be88472207f77c70052303566c787 |