Class PacketAssembler
java.lang.Object
network.ike.docs.plugin.diff.PacketAssembler
Composes the review packet's generated AsciiDoc (ike-issues#648):
the master document with cover sheet, change summary, Record of
Changes, per-topic includes, Change Glossary, and Change Index, plus
the unified-diff listings for assembly scaffolding files.
All methods are pure functions over already-loaded content — the mojo owns every file read and write.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne scaffolding (non-fragment) AsciiDoc change shown as a unified-diff listing.static final recordOne marked topic destined for the packet. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringFind a fragment's anchor id ([[id]]).injectChangeTerms(List<String> lines, List<String> changeTitles) Inject one silent change-index term per owning change after a fragment's level-1 title, so the ordinary[index]section collects a change → pages mapping.static StringmasterDoc(String title, String fromLabel, String toLabel, List<PacketAssembler.TopicEntry> topics, List<String> deleted, ChangeManifest manifest, List<List<String>> anchorsByChange, boolean hasRegistryDelta, List<PacketAssembler.ScaffoldEntry> scaffolds, String singleStampLine, List<StampRegistry.Stamp> stampsUsed) Compose the packet master document.static StringProduce a unified diff for a scaffolding file.
-
Method Details
-
unifiedDiff
Produce a unified diff for a scaffolding file.- Parameters:
path- the repository-relative path (used in headers)oldLines- the from-side lines (empty when added)newLines- the to-side lines (empty when deleted)- Returns:
- the unified diff text, without trailing newline
-
injectChangeTerms
Inject one silent change-index term per owning change after a fragment's level-1 title, so the ordinary[index]section collects a change → pages mapping. Titles are quoted because a comma in an indexterm splits levels.- Parameters:
lines- the marked fragmentchangeTitles- the owning changes' titles- Returns:
- the fragment with terms injected (a new list)
-
anchorOf
-
masterDoc
public static String masterDoc(String title, String fromLabel, String toLabel, List<PacketAssembler.TopicEntry> topics, List<String> deleted, ChangeManifest manifest, List<List<String>> anchorsByChange, boolean hasRegistryDelta, List<PacketAssembler.ScaffoldEntry> scaffolds, String singleStampLine, List<StampRegistry.Stamp> stampsUsed) Compose the packet master document.- Parameters:
title- the document titlefromLabel- human label for the from sidetoLabel- human label for the to sidetopics- marked topics, in presentation orderdeleted- repository-relative paths deleted in rangemanifest- the change manifestanchorsByChange- per-change anchor ids for context links, parallel tomanifest.changes()hasRegistryDelta- whether a registry-delta partial existsscaffolds- scaffolding diffs, in presentation ordersingleStampLine- the packet's one stamp when in-flow refs are suppressed, ornullstampsUsed- the stamps used in-flow, for the Stamp Register; empty when suppressed- Returns:
- the master document text
-