Skip to content
Simple Clojure wrapper for the java part of Neil Fraser's google-diff-match-patch library.
Java Clojure
Find file
Failed to load latest commit information.
src Initial Checkin
test/diff_match_patch_clj/test Initial Checkin
.gitignore Initial Checkin
README.md Corrects namespace usage in readme.
project.clj Initial Checkin

README.md

diff-match-patch-clj

Simple wrapping of the Neil Fraser's google-diff-match-patch library.

Usage

The main functionality is provided by the diff-match-patch-clj.core namespace:

(use 'diff-match-patch-clj.core)

You can create your own diff-match-patch object or use the default one by calling the wrappers.

Currently has diff, cleanup!, pretty-html and as-hiccup.

(diff "test" "this")
=> [Diff(EQUAL,"t"), Diff(DELETE,"e"), Diff(INSERT,"hi"), Diff(EQUAL,"s"), Diff(DELETE,"t")]

(-> (diff "test" "this")
     cleanup!)
=> [Diff(EQUAL,"t"), Diff(DELETE,"est"), Diff(INSERT,"his")]

(-> (diff "test" "this")
    cleanup!
    as-hiccup)
=> [[:span nil "t"] [:del nil "est"] [:ins nil "his"]]

Installation

diff-match-patch-clj is available as a Maven artifact from Clojars:

[diff-match-patch-clj "1.0.0-SNAPSHOT"]

License

Released under the Apache 2.0 License (same as google-diff-match-patch): http://www.apache.org/licenses/LICENSE-2.0

Something went wrong with that request. Please try again.