Jupytext lets us save and edit Jupyter notebooks as markdown or script. You can even preserve the output in your notebook while editing the script.