Skip to content

fix(docs): fix relative repo links in built pages - #315

Open
ooooo-create wants to merge 1 commit into
redai-studio:mainfrom
ooooo-create:fix/docs-source-links-313
Open

ooooo-create wants to merge 1 commit into
redai-studio:mainfrom
ooooo-create:fix/docs-source-links-313

Conversation

@ooooo-create

Copy link
Copy Markdown
Contributor

What

Fix relative Markdown links to repository files and directories outside docs/ in the generated documentation site.

Why

Links such as ../../../relax/entrypoints/train.py currently become invalid site URLs ending in train.py.html. Keep the relative links in Markdown usable on GitHub while making them work in the built site.

Fixes #313

How

  • Wrap VitePress's Markdown link renderer to resolve relative links against the current document before HTML link normalization.
  • For existing targets inside the repository and outside docs/, generate GitHub blob/main URLs for files and tree/main URLs for directories.
  • Decode URL-encoded paths for filesystem lookup, encode the generated URL path, and preserve query strings and fragments.

Testing

  • pre-commit run --all-files passes

  • Tests pass (pytest tests/)

  • New tests added (if applicable)

  • Documentation updated (if applicable)

  • All hooks passed with pre-commit run --all-files --show-diff-on-failure.

  • Production build and postprocessing passed: node node_modules/vitepress/bin/vitepress.js build docs && node docs/fix-chunk-names.js.

  • Verified 18 generated GitHub repository links in each of the English and Chinese architecture pages, including the train.py file and rollout/ directory. Internal documentation links still resolve to .html pages.

  • Opened the generated GitHub file and directory URLs successfully.

  • Python and multi-node GPU integration tests were not run because this change only affects VitePress configuration. No new test files or Markdown content changes were needed.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • CI/CD or build changes

Screenshots / Logs

✓ building client + server bundles...
✓ rendering pages...
build complete in 28.61s.

Generated links in both en/guide/architecture.html and zh/guide/architecture.html:
https://github.com/redai-studio/Relax/blob/main/relax/entrypoints/train.py
https://github.com/redai-studio/Relax/tree/main/relax/engine/rollout

Copilot AI lite review requested due to automatic review settings September 14, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rai-studio-bot

rai-studio-bot commented Sep 14, 2026

Copy link
Copy Markdown

Nyanpasu 审查看板

审查状态: ✅ 已通过

审查版本: 3a5545839f043d5efae4910ab47d4880b6445df0

审查完成,未发现需修改的问题。文档构建及后处理通过,中英文架构页各 18 个仓库链接与 9 个链接边界用例验证通过,4 项 CI 检查通过。仅涉及文档配置,未运行需多节点 GPU 的集成测试。

没有未解决的审查问题。

Powered by Nyanpasu with gpt-6-astra medium, please check the suggestions carefully.

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已完成对 3a5545839f043d5efae4910ab47d4880b6445df0 的审查,可以合入。文档构建和后处理通过,中英文架构页各 18 个仓库链接及 9 个链接边界用例验证通过,站内链接保持正常;4 项 CI 检查均通过。本次仅涉及文档配置,未运行需多节点 GPU 的集成测试。

Powered by Nyanpasu with gpt-6-astra medium, please check the suggestions carefully.

# 🐛 Bug Fix

- Rewrite relative Markdown links to existing repository files outside docs/
  before VitePress applies HTML link normalization.
- Use GitHub blob/main URLs for files and tree/main URLs for directories,
  preserving query strings and fragments.
- Keep documentation links and missing or out-of-repository targets unchanged.

## Validation

- Run pre-commit run --all-files --show-diff-on-failure successfully.
- Build the VitePress site and verify the generated source links in both locales.
- Confirm the train.py file and rollout directory URLs are accessible on GitHub.

Fixes redai-studio#313
Copilot AI review requested due to automatic review settings September 15, 2026 14:37
@ooooo-create
ooooo-create force-pushed the fix/docs-source-links-313 branch from 3a55458 to 96945c6 Compare September 15, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

【Docs】记录 docs 中相对路径引用本仓库其他路径的问题

3 participants