nb_black icon indicating copy to clipboard operation
nb_black copied to clipboard

Permanently Enabling `nb_black`

Open fweth opened this issue 5 years ago • 1 comments

I would really like to permanently enable nb_black in Jupyter Notebook, but unfortunately, when I put c.InteractiveShellApp.extensions = ['nb_black] in my IPython profile, I get the output <IPython.core.display.Javascript object> after each line of evaluation in IPython.

Editing ~/.local/lib/python3.7/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_config.py worked as intended, but is not a very elegant solution.

Is there any possibility to specify a IPython profile which should only be used by Jupyter? Or maybe make nb_black more agnostic towards IPython, so that it only shows effect in Jupyter Notebook?

fweth avatar Nov 13 '19 22:11 fweth

Is there any possibility to specify an IPython profile which should only be used by Jupyter? Or maybe make nb_black more agnostic towards IPython, so that it only shows effect in Jupyter Notebook?

I would not recommend solution 2 as one may often switch between lab or notebook. IMO solution 1 would work, but the best would be to have one name for the extension and change the behavior depending on if it runs in Jupiter lab or notebook. That being said, I haven't look at the code, so I don't know if it is feasible

mazzma12 avatar Jun 03 '20 08:06 mazzma12