Repository navigation
DXP-575: Absolute URLs and <img> conversion in generated markdown mirrors - #958
Conversation
Relative links (/foo, ./foo, ../foo) and image paths in the generated .md mirrors and llms bundles are now resolved against the page URL on https://docs.genlayer.com, so copied/fetched markdown stays navigable. Lowercase <img> tags are converted to markdown images like <Image>. check-llm-exports.js now fails on relative links or leaked <Image>/<img>. Refs DXP-575 Co-Authored-By: Claude Opus 5.5 <[email protected]>
✅ Deploy Preview for genlayer-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Legatus audit: Changes requested (commit b2ff6f1)
Validation: export generation/checks and release-version tests passed. Browser tests could not start because of the existing checker failure below. Audit worktree removed; no push, merge, or GitHub comment performed. LEGATUS-TICKET |
- #fragment links now resolve to <page-url>#fragment so they still identify the source page once exported; the checker no longer exempts them. - Reference definitions with angle-bracket destinations ([x]: </path>) keep their delimiters and resolve the inner URL instead of percent-encoding the brackets. - Add scripts/test-generate-full-docs.js (npm run test:full-docs) covering link absolutization and <img> conversion. Refs DXP-575 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Legatus audit: Changes requested (commit b03a2d0)
Both previous findings are fixed. LEGATUS-TICKET |
check-llm-exports.js flagged valid converter output such as [Setup](<https://docs.genlayer.com/...>) as relative and failed the build. The check now lives in findRelativeLink(), which unwraps optional <...> delimiters before validating the destination. The test suite now pipes every converter case through the checker and asserts relative links (bare and angle-bracketed) are still caught. Refs DXP-575 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Legatus audit: Approved (commit 9a8ba50) No merge-blocking findings. All previous findings are resolved, with regression coverage. Passed: LEGATUS-TICKET |
|
/run-e2e all |
Ticket: DXP-575
Context
Most of DXP-575 already shipped in 19558ee ("Optimize docs for LLM navigation"). That commit added per-page
.mdmirrors generated byscripts/generate-full-docs.jsduringdev/build, conversion ofCustomCard/Card/Image/Callout/Tabs/div/br, a "View as Markdown" button that opens the real.mdfile instead of a blob URL, and ChatGPT/Claude prompts that send the.mdURL. The earlier attempt, #278, was closed without merging.Two requirements were still open:
](/developers/...),](./writing-data)andsrc="/morpheus.png".<img>tags: lowercase<img>leaked through unconverted (e.g.partners/morpheus).Changes
scripts/generate-full-docs.js<img ...>is now converted to a markdown image, the same way<Image>already was.absolutizeLinks()resolves the targets of markdown links and images, reference-style link definitions, and leftoverhref/srcattributes against the page's URL onhttps://docs.genlayer.com. It resolves them the same way a browser does (new URL(href, pageUrl)).mailto:and absolute URLs are left unchanged. Fragment-only links (#section) become<page-url>#section. Angle-bracket destinations ([x]: </path>,[x](</path>)) keep their brackets, and only the URL inside them is resolved..mdmirrors and to everyllms-full.txtbundle.scripts/check-llm-exports.js(viafindRelativeLink(), which accepts bare and<...>destinations) now fails the build if a relative markdown link (outside code) or a leaked<Image>/<img>appears in the bundles.Testing
npm run test:full-docs(newscripts/test-generate-full-docs.js) → 15 cases: fragment links, root-relative,./and../links, angle-bracket inline and reference links, images,href, untouched absolute/mailto/code links, and<img>conversion. It also runs every converter output through the build checker'sfindRelativeLink()to confirm it is accepted, and confirms that relative links, bare or angle-bracketed, are still flagged.node scripts/generate-full-docs.js && node scripts/check-llm-exports.js→ OK (225 pages).origin/main: it fails with the<img>leak and the relative-link errors. With this change it passes.reading-data.md→https://docs.genlayer.com/developers/decentralized-applications/writing-datadeploying.md→.../deploying/cli-deploymentmorpheus.md→node scripts/test-release-versions.jspasses.next build) was not run. Only build-time scripts changed; no components or pages.Assumptions
public/<route>.md(served at<page-url>.md), instead of the ticket'spublic/pages/. The UI andllms.txtalready link to it.> **Note:** …blockquotes, instead of adding emojis. A text label is at least as clear to an LLM.docs/validator-guide.mdingenlayer-cli.mdx) become absolute but stay broken, same as on the site.🤖 Generated with Claude Code