Diffing utilities of last resort. Thin wrapper over difflib.
Diffing utilities of last resort. Thin wrapper over difflib.
(Chunk->map a-Chunk)
Creates a hash-map from Chunk instance.
Returned map will be something like this:
{:at long :span long :lines vector of Strings}
Creates a hash-map from Chunk instance. Returned map will be something like this: {:at long :span long :lines vector of Strings}
(Delta->map a-Delta)
Creates a hash-map from Delta instance.
Returned map will look something like this:
{:type :insert :revised chunk-map}
{:type :delete :original chunk-map}
{:type :change :original chunk-map :revised chunk-map}
Creates a hash-map from Delta instance. Returned map will look something like this: {:type :insert :revised chunk-map} {:type :delete :original chunk-map} {:type :change :original chunk-map :revised chunk-map}
(delta-maps original revised)
Run diff, get Deltas, publish them as hash-maps in a vector.
LPT: consult docs of Delta->map and Chunk->map.
Run diff, get Deltas, publish them as hash-maps in a vector. LPT: consult docs of Delta->map and Chunk->map.
(line-maps original revised)
Run diff line by line and return vector of line-by-line changes as maps.
Each map will look like this:
{:tag :insert :new String :at positive long}
{:tag :delete :old String :at positive long}
{:tag :change :old String :new String :at positive long}
{:tag :equal :old String :at positive long}
What we call quick & dirty here, may be fun for quick side by side.
Run diff line by line and return vector of line-by-line changes as maps. Each map will look like this: {:tag :insert :new String :at positive long} {:tag :delete :old String :at positive long} {:tag :change :old String :new String :at positive long} {:tag :equal :old String :at positive long} What we call quick & dirty here, may be fun for quick side by side.
(unidiff orig-path rev-path orig-lines a-Patch context-lines)
Return Unified Diff (unidiff) format as vector of strings.
Arguments:
Return Unified Diff (unidiff) format as vector of strings. Arguments: * orig-path: original file path and optional timestamp, for diff header * new-path: revised file path and optional timestamp, for diff header * orig-lines: original lines used as base for diff * a-Patch: Patch instance of original and revised lines * context-lines: number of lines to include as context.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close