Class GoalLinkRewriter
An inline monospaced goal token such as <code>ws:checkpoint-publish</code>
becomes
<a href="…/ws-goals.html#checkpoint-publish"><code>ws:checkpoint-publish</code></a>.
Links always point at the /latest/ goal-reference page
(version-independent), so a page never pins a goal link to a specific
release:
ws:<goal>→ "https://ike.network/ike-platform/latest/ike-workspace-maven-plugin/ws-goals.html#"<goal>ike:<goal>→ "https://ike.network/ike-tooling/latest/ike-maven-plugin/index.html#"<goal>
The rewrite runs against the already-rendered HTML rather than
during AsciiDoc parsing because the site is rendered by
asciidoctor-parser-doxia-module, which does not invoke
AsciidoctorJ extensions (verified — neither tree- nor postprocessors
fire). Operating on the final HTML also makes the behaviour uniform
across every ike:site-publish-deployed site with one
implementation (IKE-Network/ike-issues#783).
Tokens are skipped when they sit inside a <pre> code listing
(a command example is not a cross-reference) or are already inside an
<a> (so a hand-authored link is never double-wrapped). Only the
matched <code> spans are modified; the rest of each page is left
byte-for-byte unchanged.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intrewriteSiteHtml(Path siteDir, org.apache.maven.api.plugin.Log log) Rewrite every*.htmlfile undersiteDirin place, linking inline goal references to their latest goal docs.
-
Method Details
-
rewriteSiteHtml
Rewrite every*.htmlfile undersiteDirin place, linking inline goal references to their latest goal docs.Best-effort: a read/write failure on one file aborts the walk but is reported as a non-fatal warning rather than failing the publish. Files with no goal references are left untouched (not rewritten).
- Parameters:
siteDir- root of a rendered site tree (e.g.target/siteortarget/staging);nullor a non-directory is a no-oplog- Maven logger for the summary line- Returns:
- the total number of goal references linked
-