I would like to save my Mathematica notebooks as plain-text documents, so that I can keep them under git
version control.
I thought that File > Save as...
+ Plain Text
would do what I want, but I'm having problems with it.
First, I can't figure out how to "re-import" into Mathematica (in a form that can be readily evaluated) a notebook saved this way.
Second, the human-readable text content is overwhelmed by serializations of graphic objects, etc. Therefore, the output produced by git diff
on two versions of such text files is a nightmare.
Third, the human-readable text portions are not all that readable. Of course, some rich formatting cannot be easily converted to text, but I would like to preserve at least some of the indentation found in the original, if possible.
Is there a better approach?