diff to html (diff2html) program

Viewed 47968

I'm looking for a "diff to html" program, which would generate a static html page from a given diff/patch file.

I've googled for it of course, but apart from some scripts I've found there's no "real project" (e.g. no package in Debian/Ubuntu).

Have I missed something? Can you recommend anything?

10 Answers

You can use diff2html.py that is able to create a side-by-side diff in a static html page, from an unified diff input. The script is written in python.

cat foo.diff | python diff2html.py > foo.html

pygments has syntax highlighting for diff (and for lots of other languages), and can be used as a library or a command-line program. Is that the sort of thing you're looking for? If not please clarify the question...

Have you tried http://prettydiff.com/ as it ignores differences in white space and comments.

[Disclaimer: this is my site]

I use htmlize in Emacs. Doesn't come with Emacs, and assumes you're using Emacs. Relies on the syntax highlighting of Emacs's Diff mode. Only good for doing one file at a time. Does the right thing for me.

Related