JS Graphical Diff

Generates a graphical HTML version of any standard unified diff.

API

var diffview = function(
    diff,     /* Unified diff as a string. */
)             /* Returns an instantiated div containing graphical diff. */

Example

var diff =
    "diff --git a/Makefile b/Makefile"
    + "\nindex 2210302..d35c8ac 100644"
    + "\n--- a/Makefile"
    + "\n+++ b/Makefile"
    + "\n@@ -37,6 +37,10 @@ test: build/wixi-standalone-$(VERSION).jar"
    + "\n            --repoDir=build/master.git \\"
    + "\n            --outputDir=build/output.dir"
    + "\n "
    + "\n+testparser: build"
    + "\n+       javac -cp $(libs):build -d build src/TestParser.java"
    + "\n+       java -cp $(libs):build TestParser ~/Desktop/Untitled.txt"
    + "\n+"
    + "\n build/wixi-standalone-$(VERSION).jar: build"
    + "\n        @rm -rf work"
    + "\n        @mkdir work\n"
document.body.addChild(diffview(diff));
TODO put up an example of what it looks like.