Skip to content

docs: keep translated link targets in sync - #26

Open
Fhatu12 wants to merge 2 commits into
yhay81:mainfrom
Fhatu12:docs/sync-translated-link-targets
Open

docs: keep translated link targets in sync#26
Fhatu12 wants to merge 2 commits into
yhay81:mainfrom
Fhatu12:docs/sync-translated-link-targets

Conversation

@Fhatu12

@Fhatu12 Fhatu12 commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • Restores the missing final spec.md link target in five translated index.md pages.
  • Adds a regression test to compare Markdown link destinations between English docs pages and translated pages.
  • Keeps translated link text free to differ while requiring link targets, including duplicates, to stay aligned.

Validation

  • uv run pytest tests/test_docs.py
  • uv run ruff check .
  • uv run ruff format --check .
  • git diff --check HEAD~1..HEAD
  • Dependency-free Markdown link-target parity check

Fixes #24

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b844d7a705

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/test_docs.py Outdated
def _markdown_link_targets(page: Path) -> Counter[str]:
return Counter(
re.findall(
r"(?<!!)(?<!\\)\[[^\]\n]+\]\(([^)\s]+)(?:\s+\"[^\"]*\")?\)",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include reference-style destinations in the parity check

On pages using reference-style links, such as docs/index.md ([PEP 750] and [Babel]) and docs/comparison.md, this regex only collects inline [text](target) destinations. A translated page can therefore change or remove a [label]: target definition—leaving its rendered link broken or misdirected—while this test still passes. Parse or collect reference definitions as well so the new parity check covers the link targets already present in the documentation.

Useful? React with 👍 / 👎.

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.

Keep Markdown link targets in sync across translated documentation

1 participant