I\'m looking for a way to produce HTML files from a git-diff output, preferably using python. I\'ve been looking at http://docs.python.org/library/difflib.html without being abl
You could use the pygments commandline script to get a syntax highligthed HTML output.
Installation:
$ easy_install Pygments
Example:
$ git diff HEAD^1 > last.diff
$ pygmentize -f html -O full,style=trac -l diff -o last.diff.html last.diff
$ # mac only
$ open last.diff.html
Or shorter:
$ git diff | pygmentize -f html -O full,style=emacs -l diff
P.S. To see all available styles, try:
$ pygmentize -L styles
P.P.S. To make the pipeline complete, you can use this trick:
$ git diff | pygmentize -f html -O full,style=emacs -l diff | browser