QHub jupyterhub 主题
项目描述
请将问题提交到 https://github.com/quansight/qhub/issues
为QHub自定义JupyterHub模板
此存储库包含用于自定义JupyterHub外观的html jinja2模板。这里每个HTML文件都将覆盖https://github.com/jupyterhub/jupyterhub/tree/master/share/jupyter/hub/templates中的文件。
用法
在您的环境中安装 qhub_jupyterhub_theme
pip install qhub_jupyterhub_theme
将以下内容添加到jupyterhub配置中,以拾取新的jinja2模板目录和静态文件。
from qhub_jupyterhub_theme import theme_extra_handlers, theme_template_paths
c.JupyterHub.extra_handlers = theme_extra_handlers
c.JupyterHub.template_paths = theme_template_paths
最后,通过template_vars
自定义模板。当前选项包括
hub_title
hub_subtitle
welcome
logo
primary_color
secondary_color
- `accent_color'
text_color
h1_color
h2_color
navbar_text_color
navbar_hover_color
内部选项
cdsdashboards_enabled
cdsdashboards_restricted
qhub_theme_extra_js_urls
灵感来自测试jupyterhub配置 test_jupyterhub_config.py
。
c.JupyterHub.template_vars = {
'hub_title': 'This is QHub',
'hub_subtitle': 'your scalable open source data science laboratory.',
'welcome': 'have fun.',
}
测试
安装开发环境
conda env install -f environment.yaml
您无需重启jupyterhub即可查看custom
和templates
中的更改。通过测试脚本运行jupyterhub
jupyterhub --config test_jupyterhub_config.py
要在VSCode中运行,这里有一个launch.json配置
{
"name": "JupyterHub test",
"type": "python",
"request": "launch",
"module": "jupyterhub",
"args": ["-f", "./test_jupyterhub_config.py"],
"cwd": "${workspaceFolder}"
}
您需要确保为该项目设置Python虚拟环境已在此项目中激活。
变更日志
版本 0.3.6
- 扩展navbar链接 #16
版本 0.3.5
- 版本显示样式更新 #15
版本 0.3.4
- 更新 Readme 文件
- 公开导航栏颜色选项 #12
- 添加显示 Qhub 版本选项 #13
版本 0.3.3
- 简化 JupyterHub 配置(向后兼容)
- 为 VScode 添加测试文档
版本 0.3.2
- 添加仪表盘菜单页面和头部
- 添加自定义 js 标签功能 #11
版本 0.3.1
- 添加文本颜色和默认值到模板选项 #9
版本 0.3.0
- 添加颜色!:tada
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。
源分布
qhub_jupyterhub_theme-0.3.6.tar.gz (105.6 kB 查看哈希值)
关闭
qhub_jupyterhub_theme-0.3.6.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8d6bac64035da6d65034f7f7797802ac233da36052d6f8850389fd78b58ddbe4 |
|
MD5 | 1947664ce7a26f289fd61a7ca0c57e87 |
|
BLAKE2b-256 | fbb964ca85a42353128c627a1343d65652b56fd487d9418a548acabd54cc2135 |