How to enable line wrapping in ipython notebook

前端 未结 3 1039
青春惊慌失措
青春惊慌失措 2021-02-05 09:36

I have been trying to enable line wrapping in ipython notebook. I googled it with no results and i typed ipython notebook --help in a terminal. This gives me a ton of configurat

3条回答
  •  臣服心动
    2021-02-05 10:16

    Most of notebook is powered by Codemirror, the option you search is hence this one problem is we don't have simple way of passing configuration to CodeMirror, so you will have to figure out some javascript un custom.js to apply the configuration to the right object.

    From the top of my head and handwaving :I would say IPython.CodeCell.default_options.cm les lineWrapping to true then loop through IPython.notebook.get_cells() (already instantiated object) grab their editor attribute and setOption('lineWrapping',true).

    You can make a JS extension that does it and propose (and take inspiration) here.

提交回复
热议问题