Diff Utils

Overview

A collection of functions for generating diffs in [Unified Diff format].  The functions perform best on text documents.  

Syntax:

  • diffcurrentdocument(base_document, how_many_revisions_prior)
    • Generate a diff between the current version of a document and a previous version
    • base_document (Document) - Document to diff
    • how_many_revisions_prior (Integer) - If not specified it will default to the version immediately before current version .  If specified, this is how many revisions from current version should be used for the diff.  E.g. 1 will diff the version immediately before the current version.
  • diffdocumentversions(base_document, base_version, revised_version)
    • Generate a diff between two versions of the same document
    • base_document (Document) - Document to diff
    • base_version (Integer) - Base version of the document.  Use -1 for the current version
    • revised_version  (Integer) - Revised version of the document
  • diffdocuments(base_document,revised_document)
    • Generate a diff between the current version of two documents
    • Base_document (Document) - Base document
    • revised_document(Document) - Revised document
  • difftext(base_text, revised_text)
    • Generate a diff between two pieces of text
    • base_text (Text) - Base text
    • revised_text (Text) - Revised text
Anonymous