Skip to content

Comments

Cross-links: differentiate URL format and htmx behavior per build type#2777

Open
reakaleek wants to merge 2 commits intomainfrom
feature/codex-cross-linking
Open

Cross-links: differentiate URL format and htmx behavior per build type#2777
reakaleek wants to merge 2 commits intomainfrom
feature/codex-cross-linking

Conversation

@reakaleek
Copy link
Member

What

  • Differentiate cross-link rendering across Codex, Assembler, and Isolated build types
  • Codex builds produce path-only /r/{repo}/{path} URLs with htmx navigation (including #codex-breadcrumbs sub-header replacement)
  • Isolated builds produce absolute https://codex.elastic.dev/r/{repo}/{path} URLs with target="_blank" and no htmx
  • Assembler builds retain their existing PublishEnvironmentUriResolver absolute URLs with htmx intact
  • Improve cross-link error message to guide users toward adding the repo to docset.yml cross_links

Why

  • Codex serves multiple repos under a single site, so cross-links should navigate within the same page context using htmx
  • Isolated previews show a single repo, so cross-links to other repos should open externally
  • Assembler builds aggregate repos under elastic.co/docs, so cross-links are same-site and should also use htmx
  • The previous behavior did not distinguish between these contexts

Notes

  • CodexAwareUriResolver now accepts a useRelativePaths parameter to control relative vs absolute URI output
  • The isCrossLink flag in DiagnosticLinkInlineParser is only cleared for BuildType.Isolated with absolute URIs, preserving htmx for Assembler
  • ParserContext conditionally uses CodexHtmxAttributeProvider for Codex builds to include #codex-breadcrumbs in htmx swaps

Made with Cursor

Introduce useRelativePaths parameter to CodexAwareUriResolver so codex
builds produce path-only /r/{repo}/{path} URLs with htmx navigation,
while isolated builds produce absolute https://codex.elastic.dev URLs
with target=_blank. Assembler builds continue using their own
PublishEnvironmentUriResolver with htmx intact.

Clear isCrossLink flag only for isolated builds when the resolved URI
is absolute, so assembler same-site cross-links keep htmx behavior.

Use CodexHtmxAttributeProvider (with #codex-breadcrumbs) for codex
builds in ParserContext.

Improve cross-link error message to suggest adding the repo to
docset.yml cross_links.

Co-authored-by: Cursor <cursoragent@cursor.com>
@reakaleek reakaleek marked this pull request as draft February 24, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants