Markdown versions of all docs pages are available by appending .md to any docs URL.
rebase
Renders a page from another version’s asset tree, rewriting its shortcodes to match
Either call form works, and both produce identical HTML.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
file | path | yes | — | Path to the source Markdown under assets/. |
Example
Note
There is no live example on this page: this shortcode cannot be rendered safely in isolation. See Notes for why.
Notes
The heaviest shortcode in the module. It takes a whole page authored against one version and renders it under another, rewriting the shortcodes inside so they resolve against the version the reader is actually on.
The example is marked code-only: this cannot render without a real asset
tree and a version context.
Pipeline
Each stage is a labelled block in the template. When adding a shortcode that needs special treatment under rebase, find the right stage and add the rule there.
- Setup — resolve file path, page version and product, and look up the resource. Falls back to the bare path when the versioned path is not on disk.
- Content prep — strip front matter; mark the page for Mermaid and manual-cards detection.
- Form conversion — bulk-rewrite percent-form shortcodes to angle form
so
RenderStringprocesses them, then revert specific shortcodes back to percent form where their inner content must re-flow through Markdown (tab,steps,include).github-yamlis on that revert list too. - Source filters — strip
upstreamblocks and unwrapdownstreamblocks, so a rebased page follows the same split as a native one. - Argument injection — pass the resolved version and product into the
shortcodes that need them,
link-hextraandreuse. - Version remap — handle
keepVersionon theversionshortcode, then do the two-pass OSS-to-enterprise version-string swap through indexed placeholders. - Gate form — normalize every TOP-LEVEL angle-form
versionandconditional-textgate to percent form, sogate-emit’s raw.Innerre-enters Markdown. Nested gates stay angle, because percent would pre-render them. Runs after the remap because thekeepVersionguard is percent-only. - Render — hand the transformed Markdown to
RenderString.
The structural-HTML parity test in versioning.spec.ts compares the
everything fixture page against its rebased twin. If you add a stage rule
and forget one, that test is what catches it.
Source: layouts/_shortcodes/rebase.html