I want to have JupyterLab launch and load custom settings and overwrite advanced settings automacally.
But I can't do it although I tried three method notebook.json
/custom.js
/config.js
.
How can I do it?
My Environment
Versions
- python: 3.9.1
- jupyter-client 6.1.12
- jupyter-contrib-core 0.3.3
- jupyter-contrib-nbextensions 0.5.1
- jupyter-core 4.7.1
- jupyter-highlight-selected-word 0.2.0
- jupyter-latex-envs 1.4.6
- jupyter-nbextensions-configurator 0.4.1
- jupyter-packaging 0.10.1
- jupyter-server 1.6.4
- jupyterlab 3.0.14
- jupyterlab-pygments 0.1.2
- jupyterlab-server 2.5.0
Directory
├ ~/
├ .jupyter/
├ nbconfig/
├ notebook.json
├ config/
├ config.js
├ custom/
├ custom.js
Settings
// ~/.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;