我想让JupyterLab启动和加载自定义设置,并自动覆盖高级设置。
但我做不到,虽然我尝试了三种方法notebook.json/custom.js/config.js.
我该怎么做呢?
我的环境
版本
目录
├ ~/
├ .jupyter/
├ nbconfig/
├ notebook.json
├ config/
├ config.js
├ custom/
├ custom.js设置
// ~/.jupyter/nbconfig/notebook.json
{
"load_extensions": {
"codefolding/main": true
},
"MarkdownCell": {
"cm_config": {
"autoClosingBrackets": true,
"lineNumbers": true,
"lineWrapping": false
}
},
"CodeCell": {
"cm_config": {
"lineNumbers": true,
"lineWrapping": true
}
},
"Cell": {
"cm_config": {
"lineNumbers": true,
"lineWrapping": true
}
},
"codeCellConfig": {
"cm_config": {
"tabSize": 4,
"insertSpaces": true,
"readOnly": false,
"autoClosingBrackets": true,
"matchBrackets": true,
"lineNumbers": true,
"lineWrapping": "wordWrapColumn",
"wordWrapColumn": 95
}
}
}// ~/.jupyter/custom/custom.js or ~/.jupyter/config/config.js
var cm_config = require('notebook/js/cell').Cell.options_default.cm_config;
cm_config.tabSize = 4;
cm_config.readOnly = false;
cm_config.lineNumbers = true;
cm_config.linWrapping = true;
// cm_config.wordWrapColumn = 95;
cm_config.autoClosingBrackets = true;发布于 2021-05-09 16:26:31
解决了!谢谢你的建议@krassowski!
现在,我可以加载木星实验室高级设置时,启动时,与{sys.prefix}/share/jupyter/lab/settings/override.json如下所示。
{
"@jupyterlab/apputils-extension:themes": {
"theme": "JupyterLab Dark"
},
"@jupyterlab/notebook-extension:tracker": {
"markdownCellConfig": {
"autoClosingBrackets": true,
"lineNumbers": true,
"lineWrap": "off"
},
"rawCellConfig": {
"lineNumbers": true,
"lineWrap": "wordWrapColumn",
"wordWrapColumn": 130
},
"codeCellConfig": {
"tabSize": 4,
"insertSpaces": true,
"readOnly": false,
"codeFolding": false,
"autoClosingBrackets": true,
"matchBrackets": true,
"lineNumbers": true,
"lineWrap": "wordWrapColumn",
"wordWrapColumn": 130
}
}
}https://stackoverflow.com/questions/67458735
复制相似问题