core/packages/notebook
github-actions[bot] 6791ce569a v3.9.0 2025-05-20 08:57:13 +00:00
..
src fix: notebook diff monaco upgrade issue (#4379) 2025-02-17 17:55:00 +08:00
typings/style feat: add notebook (#3945) 2024-11-15 10:31:57 +08:00
.gitignore feat: add notebook (#3945) 2024-11-15 10:31:57 +08:00
README.md feat: add notebook (#3945) 2024-11-15 10:31:57 +08:00
package.json v3.9.0 2025-05-20 08:57:13 +00:00
tsconfig.json feat: add notebook (#3945) 2024-11-15 10:31:57 +08:00

README.md

id title
notebook Jupyter Notebook 功能模块

基于 Libro 实现的 Jupyter Notebook 功能模块,可根据集成需求按需引入。

使用时需确保环境中已安装 jupyter,并在 jupyter 配置文件中添加以下内容:

c = get_config()
c.ServerApp.allow_origin = "*"
c.ServerApp.allow_remote_access = True
c.ServerApp.allow_root = True
c.ServerApp.ip = '0.0.0.0'
c.IdentityProvider.token = '<YOUR_TOKEN>'

运行 jupyter server 启动服务,将服务地址配置到 notebookServerHost 字段、token 信息填到 notebookServerToken 字段即可token 设置为空字符串时可不填):

renderApp(
  getDefaultClientAppOpts({
    modules: [...AIModules, NotebookModule],
    opts: {
      // ...
      notebookServerHost: 'localhost:8888',
      notebookServerToken: '<YOUR_TOKEN>',
    },
  }),
);

注:目前 Notebook 能力依赖了 antd 组件库,会导致打包体积增大较多,请按需引入。