Class RegistryIndex
java.lang.Object
network.ike.docs.plugin.diff.RegistryIndex
One side's topic registry, generated from the files as they stand on
that side of a doc-diff comparison: topics grouped by domain (each entry
in the shape
idoc:topic-registry writes, built from the
:topic-*: header), and each assembly's topic membership read
from its include:: lines. No hand-kept registry file is read.
This is what lets an assembly module's idoc:diff run
project the corpus diff onto its own membership
(ike-issues#649), and what RegistryDelta compares.
-
Method Summary
Modifier and TypeMethodDescriptionassemblyRefs(String assemblyId) An assembly's topic membership, in include order.static StringFind the topic library's source root on a side: the…/src/docs/asciidocdirectory whosetopics/holds.adocfiles.static RegistryIndexGenerate the registry as it stands on one side of a comparison.static StringmembershipDelta(RegistryIndex oldIndex, RegistryIndex newIndex, String fromRef, String toRef, String assemblyId) Render one assembly's membership delta (topics added to and removed from its includes between two sides) as a small registry-delta partial for an assembly-projection packet.Resolve a topic id to its source file, relative to the registry root (e.g.
-
Method Details
-
load
Generate the registry as it stands on one side of a comparison.- Parameters:
git- repository accessref- the side to read (GitSource.WORKTREEor a committish)registryRoot- repository-relative source root of the topic library (the directory holdingtopics/), ornullwhen the repository has none- Returns:
- the index (empty when there is no topic library on that side)
- Throws:
IOException- on repository access failure
-
topicFile
-
assemblyRefs
An assembly's topic membership, in include order.- Parameters:
assemblyId- the assembly id: by IKE naming convention the module directory (and artifactId) holding the assembly'ssrc/docs/asciidoc- Returns:
- the topic ids, or
nullwhen no file of that assembly includes a topic
-
membershipDelta
public static String membershipDelta(RegistryIndex oldIndex, RegistryIndex newIndex, String fromRef, String toRef, String assemblyId) Render one assembly's membership delta (topics added to and removed from its includes between two sides) as a small registry-delta partial for an assembly-projection packet.- Parameters:
oldIndex- the from sidenewIndex- the to sidefromRef- the from-side ref, for the texttoRef- the to-side ref (may beGitSource.WORKTREE)assemblyId- the assembly to report on- Returns:
- the partial's text with a level-1 title, or an empty string when this assembly's membership is unchanged
-
findRoot
Find the topic library's source root on a side: the…/src/docs/asciidocdirectory whosetopics/holds.adocfiles.- Parameters:
git- repository accessref- the side to search- Returns:
- the repository-relative source root, or
nullwhen the repository has no topic library on that side - Throws:
IOException- on repository access failure
-