Skip to content

Latest commit

 

History

History
18 lines (17 loc) · 560 Bytes

readme.md

File metadata and controls

18 lines (17 loc) · 560 Bytes

A notebook extension to strip common leading whitespace when pasting to Jupyter Notebook cells. That is

    for x in xs:
        f(x)

is pasted as

for x in xs:
    f(x)

This is especially useful when experimenting with code that you're pulling from a module/class/function.

Dev install

jupyter nbextension install stripcommon --symlink --sys-prefix
jupyter nbextension enable stripcommon --sys-prefix

Jupyter will complain that there's an error while loading the extension. It lies. Watch the Chrome console instead.