自定义设置#

使用CLI,如果您在根目录或特定{lite-dir}/{app}/目录中创建{lite-dir}/overrides.json,这些文件将合并到{output-dir}/{app?/}jupyter-lite.json#/jupyter-config-data/settingsOverrides中。

示例#

自定义 REPL 应用程序#

假设您想自定义 REPL 应用程序的行为,并使用终端交互模式。

您可以在构建之前在 {lite-dir}/repl/ 中创建以下 overrides.json

{
  "@jupyterlab/console-extension:tracker": {
    "interactionMode": "terminal"
  }
}

interactionMode 设置为 terminal 的一个效果是将执行代码的操作从 Shift-Enter 切换到 Enter

在笔记本菜单栏中添加下载按钮#

如果您想在笔记本菜单栏中添加下载按钮,您可以在 overrides.json 中添加以下行

{
  "@jupyterlab/notebook-extension:panel": {
    "toolbar": [
      {
        "name": "download",
        "label": "Download",
        "args": {},
        "command": "docmanager:download",
        "icon": "ui-components:download",
        "rank": 50
      }
    ]
  }
}

您现在将拥有一个类似于下面的菜单栏

notebook-menu-bar-download-button