yasuki_core.card_diff.unified_diff#
- unified_diff(old, new)[source]#
A GitHub-style unified line diff from
oldtonew.- Parameters:
- Returns:
- rows
listofdict Rows for a single-column diff view, top to bottom. Each row is
{"type", "segments"}wheretypeis"context"(unchanged line),"del"(only inold), or"ins"(only innew);segmentscarry the line text as{"kind", "text"}pieces so a replaced line highlights just the words that changed. A replace is emitted as itsdelrows followed by itsinsrows, lines paired for word-level refinement.
- rows