Skip to main content

Module text_diff

Module text_diff 

Source
Expand description

Text diff views (agent view and CriticMarkup). Git/GitHub unified patches of complete document text snapshots, and other review presentations.

DOCX snapshots use the same paragraph, table, and revision-mark view as jubarte debug --check text, without clipping or a hunk limit. The patches are for review only; they do not patch the binary DOCX package. They back jubarte diff and the Python and WASM bindings’ diff_text / diff_documents shapes.

Structs§

TextOptions
Review presentation options for diff_text_view and diff_documents_view; the raw unified patch APIs above (diff_text, diff_documents) stay unclipped.
UnifiedOptions
Names written on the patch headers and the number of unchanged context lines around each change. Git’s a/ and b/ prefixes are added automatically by every formatter that prints them.

Enums§

TextFormat
Presentation of a document’s line changes.

Functions§

diff_documents
Compares two DOCX byte slices or two Markdown strings as a standard unified patch without constructing a redline. Backs jubarte diff old.docx new.docx and the bindings.
diff_documents_view
Compares two DOCX bytes or Markdown text snapshots in the review presentation options.format names. DOCX revision acceptance runs on the package before text extraction, so removed paragraphs and table rows cannot contribute phantom line numbers.
diff_text
Compares two plain-text snapshots (old, new) as a standard unified patch (Git C-style quoted names, @@ hunk headers, context-line surroundings, \ No newline at end of file markers when the last line has no newline). Backs jubarte diff and the bindings; CRLF line ends are normalized to LF. Returns an empty string when old == new.
diff_text_view
Compares two plain-text snapshots (old, new) in the review presentation options.format names.
document_text
Reads a complete textual snapshot of source — the same view jubarte debug --check text prints, preserving the snapshots’ tracked marks. Kept for callers that need the raw text of one document before comparing it; the review paths go through diff_text_view / diff_documents_view.