Package: nebari-jupyterhub-theme
InformationLinksProjectCommunityCustom Nebari JupyterHub templateThis repository contains a custom JupyterHub template for Nebari.
This template overrides the default JupyterHub templates inhttps://github.com/jupyterhub/jupyterhub/tree/main/share/jupyterhub/templates.For more details on JupyterHub templates and how they can be used check the officialJupyterHub documentation.Custom Nebari JupyterHub templateDevelopment 👩🏻‍💻PrerequisitesSetting your development environmentUsingnebari_jupyterhub_themeon your JupyterHub instance 📦Architecture 🏗Contributing tonebari-nebari_jupyterhub_theme👩‍💻Code of Conduct 📖License 📄Development 👩🏻‍💻PrerequisitesPython >= 3.8We useHatchfor development and publishing of the Nebari JupyterHub theme.We recommend you install hatch throughpipxas it modifies the Python environment in which this is installed (for more details, see theHatch documentation)pipxinstallhatchhatch-conda plugin. To install:pipxinstallhatch-condaSetting your development environmentMake a fork ofthe Nebari JupyterHub theme repositoryon your personal GitHub account.Clone this repository to your local computer:gitclonehttps://github.com/<your-username>/nebari-jupyterhub-theme.gitFrom the root of the project, create a new development environment with hatch:hatchenvcreateThis will create a new development environment with all the dependencies needed for development.
It will also installnebari_jupyterhub_themein development mode.
You can verify that your development environment is correctly set up by running the following command:$hatchenvshowStandalone
┏━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃Name┃Type┃Dependencies┃Scripts┃
┡━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
│default│virtual│││
├─────────┼─────────┼─────────────────────────┼─────────┤
│dev│virtual│configurable-http-proxy│render│
│││jupyterhub││
│││jupyterlab││
│││nodejs││
└─────────┴─────────┴─────────────────────────┴─────────┘Initialize a new shell within the development environment:hatch--envdevshellTo leave the environment you can typeexiton your terminal.Initialize a JupyterHub instance for development:hatchrundev:renderThis command will start JupyterHub with the--configoption pointing totest_jupyterhub_config.py.
You should be able to head tohttp://127.0.0.1:8081on your web browser and see the JupyterHub instance running.NoteFrom here you can log in with any username and the password set in thec.DummyAuthenticator.passwordconfiguration option intest_jupyterhub_config.py. Also note not all the extensions and integrations are available in thisdevmode.You can now modify the templates and thestyle.cssfile and see the changes reflected in the JupyterHub instance without having to restart the server.NoteThe values specified inc.JupyterHub.template_varswill overwrite the default values set innebari_jupyterhub_theme/templatesThe release process for this package is documented inRELEASE.md.Usingnebari_jupyterhub_themeon your JupyterHub instance 📦Installnebari_jupyterhub_theme:pipinstallnebari_jupyterhub_themeNoteIf you already have a JupyterHub configuration file you can jump to the next step. Otherwise, follow the instructions in theJupyterHub documentationto generate a configuration file first.Add the following to you JupyterHub configuration file to pick up the newjinja2templates directory and static files:fromnebari_jupyterhub_themeimporttheme_extra_handlers,theme_template_pathsc.JupyterHub.extra_handlers=theme_extra_handlersc.JupyterHub.template_paths=theme_template_pathsOptional- if you need to further customize the UI you can modify thetemplate_varswithin your JupyterHub config file by adding the following lines to it:# minimal configuration example overwriting the default values in the nebari_jupyterhub_themec.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:#9e17b7)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: Navigation bar links and text color (default:#1c1d26)navbar_hover_color: Hover color for navigation bar links (default:#00a3b0)display_version: Display the JupyterHub version in the footer (default: False)NoteThe default colors, typefaces and logos are chosen based on the Nebari branding. You can find more about this on theNebari design repository.:computer: You can see an example of these variables and the configuration intest_jupyterhub_config.py.Nebari internal options:cdsdashboards_enabled: This requirescdsdashboardsto be present in the JupyterHub environment (default: False)cdsdashboards_restricted: This requirescdsdashboardsto be present in the JupyterHub environment (default: False)nebari_theme_extra_js_urlsArchitecture 🏗This repository is structured as follows:.github: GitHub Actions configuration files and repository templatesimages: Images used in this READMEnebari_jupyterhub_theme: Python package containing thejinja2templates and static filespyproject.toml: Python project configuration filetest_jupyterhub_config.py: Example JupyterHub configuration file - used byhatch run dev:renderto start a local JupyterHub instance for local development.RELEASE.md: Release process documentation.pre-commit-config.yaml: Configuration file for thepre-committool (note we use pre-commit CI to automatically run pre-commit on all PRs and update the hooks)Contributing tonebari-nebari_jupyterhub_theme👩‍💻Thinking about contributing? Check out ourContribution Guidelinesto get started.Code of Conduct 📖To guarantee a welcoming and friendly community, we require all community members to follow ourCode of Conduct.License 📄nebari-nebari_jupyterhub_themeis licensed under theBSD-3 OSI licenses.