jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.73k stars 4.97k forks source link

auto format? #946

Closed lfz closed 7 years ago

lfz commented 8 years ago

It would be nice if the editor integrate the auto format function~

Carreau commented 8 years ago

It's hard as the frontend support ~50 languages. So it's likely have to be done via an extension.

jankatins commented 8 years ago

See https://github.com/ipython-contrib/IPython-notebook-extensions/issues/365

KwatMDPhD commented 5 years ago

https://github.com/KwatME/clean_ipynb will do

davidlattimore commented 5 years ago

Has it been considered if Jupyter kernels could provide code formatting? I got a feature request to integrate rustfmt into the evcxr (Rust) Jupyter kernel. If it were just a matter of implementing an API in the kernel that accepted a string and returned that string auto-formatted, it'd be pretty easy. But I'm not sure I want to write custom client-side code to call the auto-formatter in the kernel. For starters, if every kernel did that, then there'd be many different and inconsistent UIs for how to trigger auto-formatting.