I often need to create two versions of an ipython notebook: One contains tasks to be carried out (usually including some python code and output), the other contains the same text plus solutions. Let's call them the assignment
and the solution
.
It is easy to generate the solution document first, then strip the answers to generate the assignment (or vice versa). But if I subsequently need to make changes (and I always do), I need to repeat the stripping process. Is there a reasonable workflow that will allow changes in the assignment
to be propagated to the solutions
document?
Partial self-answer: I have experimented with leveraging mercurial's hg copy
, which will let two files with different names share history. But I can only get this to work if assignment
and solution
are in different directories, in two linked hg
repositories. I would much prefer a simpler set-up. I've also noticed that diff
gets very confused when one JSON file has more sections than another, making a VCS-based solution even less attractive. (To be clear: Ordinary use of a VCS with notebooks is fine; it's the parallel versions that stumble).
This question covers similar ground, but does not solve my problem. In fact an answer to my question would solve the OP's second remaining problem, "pulling changes" (see the Update section).