【问题标题】:Setting custom plugin in sidebar open by default - Jupyterlab在侧边栏中设置自定义插件默认打开 - Jupyterlab
【发布时间】:2019-09-06 21:38:46
【问题描述】:

在 Jupyterlab 中,文件浏览器插件默认是打开的。如何更改此设置以在启动时默认打开自定义插件。

在我的自定义插件的激活函数中,我有以下sn-p,我认为更改需要在这里-

// If the layout is a fresh session without saved data, open my custom plugin
  app.restored.then(layout => {
    if (layout.fresh) {
    console.log('This is a fresh launch, open custom plugin by default');
     //do something here
    }
  });

【问题讨论】:

    标签: jupyter-notebook jupyter jupyter-lab


    【解决方案1】:

    您可以在 active 函数中执行类似操作:

    app.restored.then(() => {
      labShell.activateById(formationPanel.id);
    });
    

    灵感:https://github.com/jupyterlab/jupyterlab/blob/master/packages/filebrowser-extension/src/index.ts#L687

    【讨论】:

      猜你喜欢
      • 2020-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-29
      • 1970-01-01
      • 1970-01-01
      • 2016-05-12
      相关资源
      最近更新 更多