tags:

views:

2235

answers:

6

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?

A: 

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.

ashawley
+2  A: 

how about Text-Diff-HTML, difflib.HtmlDiff, CSDiff?

ax
+3  A: 

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...

puetzk
Pygments is cool, it's too bad they don't support side by side diff rendering.
icco
This was useful for me: `diff -U9999999 -y file_before.php file_after.php | pygmentize -l diff -f html -O full -o file_diff.html`
jwhitlock
+1  A: 

http://www.sourceforge.net/projects/diff2html

+1  A: 

There's also 2html in Vim, which works very well, and it's built-in: it takes a file that Vim knows how to highlight its syntax, and creates an HTML with the correct formatting. To use it, just open the wanted file with Vim, and source the 2html script. It will open the converted file in a new buffer, which can be saved. Here:

vim example.diff

and then in Vim,

:so /usr/share/vim/vim72/syntax/2html.vim
:wqa
Daniel Hershcovich
A: 

docdiff can generate html with colors.

asocialpsihopat