Skip to main content

Module diff

Module diff 

Source
Expand description

Structural diff over AdfDocument.

Produces an in-memory IR (Diff) that the diff_format module renders into the YAML output for confluence_compare. The diff is structurally aware: it walks the ADF tree, splits documents into heading-delimited sections, and emits per-block change records rather than character-level deltas over a serialization. See the design notes in issue #706.

Node identity uses a three-tier matcher:

  1. Natural-key: attrs.localId for table / tableRow / tableCell, attrs.id for media / mention, attrs.url for inlineCard / blockCard, top-level localId for expand / nestedExpand.
  2. Content-hash: stable hash of the canonicalized subtree, bucketed by node type. Catches “moved without edit” cases.
  3. Positional: index-based pairing of the residual.

Structs§

CellDelta
A single modified cell.
CodeBlockDelta
Code-block change.
Diff
Diff between two ADF documents.
DiffOptions
Diff configuration.
DiffStats
Aggregate counts across the diff.
ListDelta
List change.
NodeSnapshot
Snapshot of a block as plain text, used for added/removed entries.
OpaqueDelta
Fallback delta for block types without a specialized renderer.
ParagraphDelta
Paragraph-level prose change.
SectionDiff
A single section-level diff entry.
TableDelta
Table change (one or more cells modified).

Enums§

ChangeKind
Coarse change classification.
NodeDelta
A per-block delta inside a section.

Functions§

diff_documents
Computes a structural diff between two ADF documents.