diff --git a/images/jupytext_menu.png b/images/jupytext_menu.png new file mode 100644 index 0000000..cb35dba Binary files /dev/null and b/images/jupytext_menu.png differ diff --git a/pages/merlin6/04 jupyterhub/jupytext.md b/pages/merlin6/04 jupyterhub/jupytext.md new file mode 100644 index 0000000..38b7d25 --- /dev/null +++ b/pages/merlin6/04 jupyterhub/jupytext.md @@ -0,0 +1,27 @@ +--- +title: Jupytext - efficient editing +#tags: +#keywords: +last_updated: 30 September 2019 +#summary: "" +sidebar: merlin6_sidebar +permalink: /merlin6/jupytext.html +--- + +[Jupytext](https://github.com/mwouts/jupytext) is a Jupyter serverextension that allows creating a text file from a notebook that can be kept in sync with it. The file can be created in a number of formats, e.g. *markdown, *.py (light Script)*, and others. You can then efficiently work on that file using an IDE or text editor. `Jupytext` will keep the both the notebook and this **paired** file in sync. + +## Creating a paired file in python format for efficient refactoring + +From your notebook, go to the `file` menu and navigate to the `jupytext` submenu. Select the **light script** pairing option. This will create a `*.py` file version with the same basename as your notebook file. + +{% include image.html file="jupytext_menu.png" caption="Jupytext menu" max-width=501 %} + +You can edit that file separately in your favourite python editor. The markdown text parts will be conserved in the file in the form of python comments. + +When you save the file and do a browser page reload of your jupyter notebook, you will see all the changes caried over into your jupyter notebook. + +## Further information + +Please refer to + * [the Jupytext FAQ](https://jupytext.readthedocs.io/en/latest/faq.html) + * [the Jupytext documentation](https://jupytext.readthedocs.io/en/latest/index.html)