How to separate 2 laptops at the initial level?

Does anyone know a tool to find the difference between two laptops at source level?

The laptop comparison tool in Workbench 2 seems to work at the internal level of a data structure that doesn't suit me. I am looking for a tool that considers differences at the initial level (which can be seen when viewing a laptop, that is, not in FullForm).

I am using V8 Mathematica on windows.

EDIT1:

How do I display output / report from NotebookDiff in a more readable form?

enter image description here

+7
source share
3 answers

This answer is based on a discussion in the comments on other parts of this question. It can also (and should) be automatic if it is used with any regularity. This can be done by marking the cells you want to compare and using NotebookFind to find the cells to extract and compare.


The solution for comparing only one large cell of code (as is sometimes the case when creating demonstrations ) is to copy the code to InputForm from both laptops

enter image description here

and paste it into a simple comparison tool like Quick Diff Online which then displays the standard diff for you:

enter image description here

The above code was taken from one of the Nasser demos .


Another option is to use CellDiff from the AuthorTools package.

 Needs["AuthorTools`"]; CellDiff[Cell["Some text.", "Text"], Cell["Some different text.", "Text"]] 

Celldiff

To use in your demos, you can copy cell expressions from two versions by right-clicking on the cell brackets:

enter image description here

+10
source

There is an undocumented package in the built-in add-ons (in $InstallationDirectory/AddOns/Applications ) called AuthorTools . After loading, it provides the NotebookDiff function, which provides some basic diff functions:

 Needs["AuthorTools`"]; nb1 = NotebookPut[ Notebook[{Cell["Subsection heading", "Subsection"], Cell["Some text.", "Text"]}]]; nb2 = NotebookPut[ Notebook[{Cell["Edited Subsection heading", "Subsection"], Cell["Some different text.", "Text"]}]]; NotebookPut@NotebookDiff [nb1, nb2] 

Since this package is undocumented, make sure that it is potentially buggy and is not considered a supported function, but I hope you still find it useful.

Please note that you can also get pens for laptops, for example:

 nb1 = NotebookOpen["path/to/a/notebook.nb"] 

and the list of laptops currently open in the interface

 Notebooks[] 
+9
source

If you need to work with laptops, then NotebookDiff in AuthorTools is probably best. If this is an important part of your workflow (due to version control or some other restriction) and you have some flexibility, you may need to move the code from your existing laptop (.nb) to the package file (.m), which will saved as plain text. You can still open and edit package files in the interface for Mathematica notebooks, but you get the added benefit of being able to differentiate them using existing word processing tools.

+2
source

All Articles