Start by installing your environment with conda:
conda env create -f environment.yml
conda activate notebook_collaborationTake a look at the first tutorial in src_notebooks/Tutorial0_Template.py. As it is a pure python script, you
first need to enable jupytext to display it as a notebook:
- If you use
jupyter notebook, run the following commandjupyter serverextension enable jupytext - If you use
jupyter labyou have to right click "Open with -> notebook" to open the python scripts with the notebook interface.
In this first tutorial you will see how to use tags to generate the two versions of your notebooks:
- the student version in which answers are removed,
- the teacher version in which answers are kept.
This template allows team work on notebooks:
- Collaborators work on the python scripts in
src_notebooks, as different versions of.ipynbfiles cannot be easily merged with git. - Two notebooks are generated per python script for (student + teacher) by running
makeat the root of the repo.*
If you want to add previously made .ipynb files, please convert them to .py before adding them to the repo:
jupytext path/to/notebook.ipynb --to py -o ./src_notebooks/notebook.pyTo remove all the notebooks generated, you can run make clean.
* If you run Windows and do not use WSL, then make does not work. Run python .build\build_versions.py instead.
A jupyter book can be built from the notebooks. To customize your notebook, consider updating the following files:
_toc.ymlallows to choose which notebooks or markdown files should be included in the book,_config.ymlcontains meta-data about your book and your repository,index.mdis the first page of your book.
At the root of the repository, execute the following code:
make
cd jupyter-book
makejupyter-book.
Windows cannot easily use Makefiles. You have to run the commands contained in the Makefiles yourself: Starting at the root of the repository:
python3 .build/build_versions.py
cd jupyter-book
mkdir -p _build/.jupyter_cache
jupyter-book build .
jupyter-book.