June 2011 |
|
August 2011 |
I updated htmlDiff.py to add --diffOnly so that it only prints out lines with differences:
cplager@Flipper> htmlDiff.py --diffOnly CLPElog*pm > diff.html
This is my first entry in my "personal" elog (where personal really means hosted on my personal web server instead of a work web server). Still won't be very interesting, but I need a place to organize things that I do.
Python has a nice diff engine built in called difflib (see this for a nice example of how to use it). Using this, I wrote htmlDiff.py which diffs two lists of strings. diff.html is the output (which is supposd to be self-expanitory and uses diff.css).
Clearly not a finished product, but should be quick to turn this into something useful.
I updated htmlDiff.py to be useful:
cplager@Flipper> ./htmlDiff.py CLPElog.pm CLPElog_old.pm --css ../diff.css > diff.html(The css option is made so that I can have one copy of the diff.css file and still easily put output into my elogs.)
Google looks like they have a nice diff engine as well. I can imagine trying to hook it up in the future.
I will probably also make a side-by-side mode as well as possibly a text output version as well (using colors still, of course).