Skip to content

fix viewer: absolute and relative links now both produce graph edges - #23

Open
milanjaros wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
milanjaros:fix/viewer-absolute-link-edges
Open

milanjaros wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
milanjaros:fix/viewer-absolute-link-edges

Conversation

@milanjaros

Copy link
Copy Markdown

generate_visualization and viewers it produces according to OKF v0.2 §6.1 link forms

Python side turns relative links into graph edges/backlinks, JS side makes absolute links clickable in detail panel. A bundle using the spec's recommended absolute form (bundles/acme_retail) has missing edges for every one of its cross-references. bundles using the relative form (other three sample bundles) do not have clickable in-panel navigation at all.

  • src/reference_agent/viewer/generator.py / _extract_links does not skip absolute (bundle-relative) links now. It resolves them against bundle_root, and relative links against the linking document's own directory, as two explicit branches. Singel doc_dir / target can't handle both: pathlib treats leading / as filesystem-root-absolute and silently discards doc_dir).
  • src/reference_agent/viewer/static/viz.js / rewriteInternalLinks now resolves relative links via new resolveRelativeLink() helper that walks ./.. segments against concept id whose body is being rendered (showDetail already had that id, it just wasn't threaded through). The absolute-form handling is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant