I want to create Jupyter notebooks for teaching, which shall be delivered in two versions:
- A full “textbook” with explanations in markdown cells and example code in code cells.
- As above, but with most code cells being empty such that the students have to type all the code themselves.
Obviously, I do not want to do this manually in Jupyter, so I need a way to automatically clear those code cells (exceptions are rare and can be marked somehow). Given that notebooks are stored as sources of Python objects, I could write a simple script to directly modify those. However, this feels like I am re-inventing the wheel instead f using some existing, dedicated method – which what I am seeking in this question.
I briefly considered using NBGrader. However, while I am quite confident that this could solve my problem, it seems overkill for this purpose and require extra effort to make things work.