improved jupytext documentation

This commit is contained in:
feichtinger 2019-09-30 10:03:58 +02:00
parent 7ea62a9137
commit 7f09f72e84

View File

@ -8,7 +8,9 @@ sidebar: merlin6_sidebar
permalink: /merlin6/jupytext.html 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. [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 **with the aim of using more efficient editors or IDEs on it**. The file can be created in a number of formats, e.g. *markdown, *.py (light Script)*, and others. `Jupytext` will keep the both the notebook and this **paired** file in sync: If you save the paired file, changes will be carried over into the notebook, and vice versa. This pairing will persist also in new sessions of your notebook until you explicitely remove it again.
The paired file contains only the cell contents and not the output. Therefore it also is **much better suited for revision control**, since the differences between versions are limited to the cells and these file formats yield more meaningful text differences than the default notebook storage format.
## Creating a paired file in python format for efficient refactoring ## Creating a paired file in python format for efficient refactoring
@ -18,7 +20,15 @@ From your notebook, go to the `file` menu and navigate to the `jupytext` submenu
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. 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. When you save the file and do a browser page reload of your jupyter notebook, you will see all the changes carried over into your jupyter notebook.
## Creating a paired file in mardown format for efficient text authoring
If you want to efficiently work on the descriptive text base of your notebook, just pair it using the `Pair notebook with Markdown` menu item and edit the generated `*.md` file with your favourite Markdown editor.
## Disable autosaving when working on the paired file
Your notebooks usually auto save every 2 min (default). Turn this feature off when working with the paired file. Otherwise Jupyter will continue to save the state while you are editing the paired file, and the changes will be synced to the disk version of the paired file. You can disable the autosave by unchecking the `Autosave notebook` menu item in the Juytext menu (see above image).
## Further information ## Further information