Implement Markdown diffs
I'm trying to implement diffing/merging of markdown cells right now. The diffing is trivial, however I cannot figure out which templates or code to modify to teach the server to represent the diffed cells (right now they are just omitted). Can you please provide some pointers to the code responsible for rendering the diff or merge?
Hello, The short answer is, it's in nbdiff/server/static/js/nbdiff.js It's rendered in javascript with the help of IPython rendering code. I'll have to refresh my memory to see how it was done if you want more pointers. I'm not sure I remember what this enhancement is about, because when I diff/merge I actually see Markdown properly formatted.
It's properly formatted, but it isn't diffed with the current master, so the cells are basically considered indivisible.
I'll see if I can modify the server, but more pointers would of course be appreciated.
Yes, you are correct. I'll take a look at it.
The diff code is boilderplate, see akhmerov/nbdiff@4984ba97337c1868c0d895fd7b78c556ce317bc3
Looking through the server code would take me more time, but it's probably as simple.
It looks right. For the front end, you can add a new condition here https://github.com/tarmstrong/nbdiff/blob/master/nbdiff/server/static/js/nbdiff.js#L295 and create a new class to handle it like HeaderDiff, or reuse it if it works for you.
See #235, it was easy indeed. Any pointers for nbmerge?
I'm not sure if I can help much. ~~It probably has to be done from scratch.~~ I'll take a look at what can be done.
OK, nbmerge anyway only works on cell level even for code cells. So then there's nothing easy I can do, and the pull request is complete.