Skip to main content

Module diff_format

Module diff_format 

Source
Expand description

Output rendering for the Confluence compare and compare_section tools.

Turns a Diff (from super::diff) plus surrounding metadata into the YAML output schema described in issue #706. Three detail levels:

  • Summary — counts only.
  • Outline — per-section change kind + one-line summaries + cursors.
  • Full — embeds per-section deltas, budget-truncated with continuation.

Cursors are stateless: an opaque base64url-encoded JSON record carrying {page_id, from_v, to_v, section_path} so confluence_compare_section can re-fetch both sides without server state.

Structs§

ByKind
Counts grouped by change kind.
CompareContext
Side-channel data the renderer needs beyond the Diff itself.
CompareOutput
Top-level YAML output for confluence_compare.
Continuation
Continuation pointer when output was truncated.
Cursor
Opaque cursor payload carried in cursor and continuation.next_cursor.
Filter
Filter applied to the rendered output (post-diff).
Includes
Which top-level fields to include in the output.
LabelChange
Label changes between two versions.
NetCounts
Net character and word change counts across the entire diff.
PageHeader
Page identity header for the compare output.
SectionRecord
One section’s record in the output.
SummaryBlock
Aggregate counts across all sections.
TitleChange
Title-change record. Emitted only when titles differ.
VersionInfo
Per-version metadata.
VersionPair
Pair of version metadata records (from / to).

Enums§

Detail
Detail level for the compare output.
SectionFormat
Output format for render_section.

Constants§

DEFAULT_OUTPUT_BUDGET
Approximate output budget, in bytes of YAML. The default of ~16 KiB corresponds to roughly 4000 tokens at 4 chars/token.

Functions§

apply_filter
Applies a Filter in place. Sections that fail the predicate are removed from the diff.
render
Renders a Diff into a CompareOutput at the given detail level.
render_section
Renders a single section diff in the requested format. Used by confluence_compare_section.