2016-11-25 3 views

답변

0

이 작업을 수행하는 올바른 방법은 How do I change the autoindent to 2 space in IPython notebook에 bpirvu의 매장 대답입니다 :

그냥 ~/.jupyter/nbconfig/notebook.json을 편집 할 수 있습니다. 여기에 관련 설정을 포함하는 완전한 notebook.json입니다 : http://jupyter-notebook.readthedocs.io/en/latest/frontend_config.html을 다음 Jupyter 문서는이 주제에 부족하고 indentUnit는 여기에 언급 아마 때문에, 웹의 주위에 더 유행의 더 해키 솔루션도 있습니다

{ 
    "CodeCell": { 
    "cm_config": { 
     "indentUnit": 2 
    } 
    } 
} 

. 이 솔루션은 브라우저의 자바 스크립트 콘솔을 열고 당신을 위해 편집 ~/.jupyter/nbconfig/notebook.json을 끝

var cell = Jupyter.notebook.get_selected_cell(); 
var config = cell.config; 
var patch = { 
     CodeCell:{ 
     cm_config:{indentUnit:2} 
     } 
    } 
config.update(patch) 

를 입력하는 것입니다.

+0

두 번째 콘솔 솔루션을 사용하면 다음과 같은 오류가 발생합니다. Uncaught TypeError : config.update is not function; : 8 : 8; Meh. – xtian

관련 문제