fix(docs): rewrite env README relative links in generated stubs - #1101
Open
Cunninger wants to merge 1 commit into
Open
fix(docs): rewrite env README relative links in generated stubs#1101Cunninger wants to merge 1 commit into
Cunninger wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1095
scripts/sync_env_docs.pyinlined each env README intodocs/source/environments/<slug>.mdbut only rewrote HTMLsrc="assets/"image paths. Markdown links such as[example](../../examples/foo.py)stayed relative, so they resolved from the docs stub (wrong depth) on the published site.This extends stub generation to rewrite markdown links that escape
envs/<env>/into GitHub blob/tree URLs (the conventionbrowsergym/pelican_svgalready use by hand). Extra../segments that walk out of the repo (e.g.git_env's../../../examples/...) are stripped so they still map to the intended path.--checkalready treats rewritten stubs as the expected content, so leftover relative links fail CI until--fixis run. Regenerated the currently affected stubs (agent_world_model,carla,git,opencode,repl).Tests:
9 passed;
--checkis clean.RFC: not required (docs generator only, no public API / core change).
Note
Low Risk
Docs sync tooling and generated markdown only; no runtime API or environment behavior changes.
Overview
Fixes broken example and RFC links on the published docs site when env READMEs are inlined into
docs/source/environments/*.md(issue #1095). Previously only HTMLassets/image paths were absolutized; markdown links like../../examples/foo.pystayed relative and resolved from the wrong path.scripts/sync_env_docs.pynow rewrites markdown links that point outsideenvs/<env>/into GitHubblob/treeURLs (andrawfor images), including normalizing over-long../chains (e.g.git_env’s../../../examples/...). Stub generation calls this duringgenerate_stub, so--checkin CI expects the rewritten output.Regenerated affected stubs (agent_world_model, carla, git, opencode, repl) and added
tests/scripts/test_sync_env_docs.pyfor path resolution, link rewriting, and integration viagenerate_stub.Reviewed by Cursor Bugbot for commit 99e46a9. Bugbot is set up for automated code reviews on this repo. Configure here.