默认情况下,在侧边栏中设置自定义插件 - Jupyterlab



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

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

// 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
}
});

你可以在active函数中做类似的事情:

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

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

最新更新