Does anyone know of a script that can accept a raw diff file and pretty print HTML output [which would be easier to review/mail]? A google search returned me some results like //kafka.fr.free.fr/diff2html/
However all of these scripts require two files as input [they don't even accept two directories]. My diff output is the diff between two svn branches
asked Sep 30, 2010 at 4:58
qwertyqwerty
3,6532 gold badges25 silver badges42 bronze badges
I finally used diff2html.py to create static html output of a side-by-side diff, given my unified diff intput
miken32
40.5k15 gold badges100 silver badges140 bronze badges
answered Apr 27, 2011 at 6:15
qwertyqwerty
3,6532 gold badges25 silver badges42 bronze badges
0
You
might be interested to cdiff
, a term based tool to display side by side, incremental, and colorful diff, the design is exactly to take unified diff from stdin or revision controlled workspace.
You can just send raw diff for review if your peer is using cdiff
too.
PS: I am the author of coderev and cdiff, I know cdiff is better in both design and quality :]
answered Feb 25, 2013 at 7:18
ymattwymattw
1,09910 silver badges7 bronze badges
I've just found coderev. This might worth a try...
answered Dec 3, 2011 at 6:55
IstvánIstván
5181 gold badge5 silver badges17 bronze badges
1
I would try a syntax highlighter, e.g. pygments handles diffs just fine.
answered Sep 30, 2010 at 5:06
Benjamin BannierBenjamin Bannier
51.8k11 gold badges62 silver badges80 bronze badges
0
The best option for me is aha [Ansi HTML Adapter - //github.com/theZiz/aha]
$ svn diff | colordiff | aha > /tmp/diff.html
answered Jul 30, 2017 at 12:01
rpetrpet
1361 silver badge6 bronze badges
With the evolution of diff and the existence of "aha", it's pretty simple now.
diff -y --color=always input1.tsv input2.tsv | aha --black > output.html
I also found this on //unix.stackexchange.com/a/45390/378998
answered Sep 10, 2020 at 21:14
Lon KautLon Kaut
2,3592 gold badges10 silver badges8 bronze badges
how can i get 2 pages, and output the difference between those. getting the pages not a problem, but stuck on how to get the difference....i need a library for ruby OR php
thank you.
asked Sep 10, 2009 at 1:18
2
answered Sep 10, 2009 at 1:25
JasonWoofJasonWoof
4,0961 gold badge19 silver badges28 bronze badges
1
Not exactly what you asked for, but you might find it interesting and/or useful, but there is a Javascript diff library which might work for your needs.
answered Sep 10, 2009 at 1:30
Mike BuckbeeMike Buckbee
6,6932 gold badges32 silver badges34 bronze badges
For PHP, I'd suggest looking at the daisydiff project. This work was done to create a visual diff for Mediawiki.
Otherwise, the easiest thing to do would be to shell out to the diff program, and transform the results into html.
answered Sep 10, 2009 at 1:39
brianeggebrianegge
28.6k13 gold badges74 silver badges98 bronze badges