DEMO PR: add styleguide + checks#4
Merged
Merged
Conversation
…ode blocks to specify text format, and enhance clarity across various how-to and reference pages. Added style check script to package.json.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | 3dc103f | Commit Preview URL Branch Preview URL |
Jun 16 2026, 10:47 PM |
Resolves the blocking style:check failure (em dashes in prose). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
verify-style.mjs writes a Markdown report to $STYLE_REPORT when set (no-op locally). docs-style.yml runs the check, posts/updates a single sticky comment with the findings, and still fails the job on blocking issues so enforcement is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Styleguide check✓ 126 en pages — 0 blocking, 11 warnings docs/pages/en/explanation/autobahn.mdxdocs/pages/en/explanation/consensus.mdx
docs/pages/en/explanation/ethereum-compatibility.mdx
docs/pages/en/how-to/monitor-node.mdx
docs/pages/en/how-to/troubleshoot-node.mdx
docs/pages/en/reference/indexers.mdx
docs/pages/en/reference/ramps.mdx
docs/pages/en/reference/system-transactions-api.mdx
docs/pages/en/reference/wallets.mdxEnforced by |
The report now renders each path as a clickable GitHub blob URL pinned to the PR head SHA, with #L line anchors for line-locatable findings (em dashes, marketing words, untagged code fences). Falls back to plain paths when STYLE_REPO_URL is unset (local runs). Line numbers account for the stripped frontmatter offset. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
verify-style.mjs emits a STYLE_SUGGESTIONS JSON of safe mechanical fixes (em dash -> colon, per line). The workflow maps PR diff hunks to added line numbers and posts each in-diff fix as a GitHub suggested-change review comment (with a marker so reruns replace prior suggestions rather than stacking). Findings on unchanged lines stay in the summary comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds an "Automated checks" section to STYLEGUIDE.md covering what style:check enforces (blocking vs warnings) and how the docs style workflow surfaces results: a sticky summary comment with line-anchored links, plus applyable inline suggestions for em-dash fixes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
discover() returned explicit paths verbatim, bypassing the source_sha freshness gate. Since CI passes every en page changed in the PR (git diff base...HEAD), each push re-translated the entire PR changeset through Opus — even pages whose cn/ko already matched — exhausting the rate limit / credit balance. Explicit paths now flow through the same missing-or-drifted check used by full discovery, so an in-sync page is a no-op. Added --force to re-translate regardless (intentional local re-runs). Verified: an in-sync page passed explicitly now reports "translating 0 page(s)" and makes no API call; drifted/missing pages are still selected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replaces the Claude Opus 4.8 + adaptive-thinking translation calls (overkill and expensive for a translation task) with a single ~30-line fetch-based helper, docs/lib/llm.mjs, exporting complete(). Both i18n scripts call only that — provider, base URL, key, and model are env-driven, so swapping provider/model is config, never a code edit. - docs/lib/llm.mjs: OpenAI-compatible /chat/completions over native fetch (no SDK), small retry on 429/5xx. LLM_BASE_URL defaults to OpenRouter; TRANSLATE_MODEL defaults to a cheap model; optional REVIEW_MODEL enables a second QA pass. - i18n-translate.mjs: translate (+ optional review) through complete(), plus a deterministic structural check (frontmatter present, code-fence count matches, no stray fence wrapper) that fails a bad generation instead of writing it. Mismatch-only discovery and --force are unchanged. - i18n-sidebar.mjs: same swap; keeps the JSON entry-count guard. - Drop the @anthropic-ai/sdk dependency (no remaining importers). - Workflow uses LLM_API_KEY from secrets.OPENROUTER_API_KEY + model env vars. - CLAUDE.md: env-var examples + note that provider/model are swappable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…output The placeholder google/gemini-2.0-flash-001 returned 404 "No endpoints found" on OpenRouter. Switch the default TRANSLATE_MODEL and the workflow to google/gemini-2.5-flash and raise MAX_OUTPUT_TOKENS to 32000 to use its larger output window so long pages don't truncate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gemini-2.5-flash localized internal link paths itself — emitting language tags (/zh-CN/, /ko-KR/) and a duplicated section instead of leaving /en/ for localizeLinks to convert — which broke 65 internal links and failed the vocs build (deadlinks). localizeLinks now rewrites ANY locale/lang prefix (en|cn|ko|zh|zh-cn|ko-kr) in a markdown href to the file's locale and collapses a duplicated section segment, touching only the locale prefix (asset paths like /images/ are left alone). The system prompt also tells the model to keep /en/ hrefs verbatim. Repaired the already-committed translations via the no-API --relink pass (cn: 12 files, ko: 3). docs:build now passes with 0 deadlinks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ommit git add -A in the previous commit swept in vocs-build output (9 .woff2 fonts generated from the tracked .ttf sources, plus a rebuilt styles.css). Untrack the woff2, restore styles.css, and gitignore docs/public/fonts/*.woff2 so the build artifacts don't get committed again. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # docs/pages/cn/explanation/core-concepts.mdx # docs/pages/cn/explanation/usdt0-behavior.mdx # docs/pages/cn/reference/connect.mdx # docs/pages/ko/explanation/core-concepts.mdx # docs/pages/ko/explanation/usdt0-behavior.mdx # docs/pages/ko/reference/connect.mdx
…EGUIDE Mechanical rule specifics lived in two places — constants in verify-style.mjs and prose in STYLEGUIDE.md — so changing one risked drifting from the other. - verify-style.mjs: consolidate the tunable specifics (diataxis values, exempt folders, description cap, marketing words) into one labeled RULES block marked as the single source of truth; add `--rules` to print the enforced rules. - STYLEGUIDE.md: stop restating the values (length cap, marketing-word list, diataxis enum). It now links to RULES / `--rules`, and gains an "Updating the styleguide" section: mechanical rule → edit RULES; judgment rule → edit prose. Changing an enforced value is now a one-place edit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… enforcement) - DR004: swappable OpenAI-compatible llm.mjs seam, OpenRouter + cheap model default, optional review pass, structural + link-normalization guards, and the mismatch-only discovery fix. Supersedes DR002 §5-6 engine internals. - DR005: mechanical-vs-judgment split, single RULES source + --rules, verify-style.mjs, and the docs-style PR comment + inline-suggestion design. - DR002: superseded-by-DR004 pointers at §5/§6 and the verification commands; the sync contract / CI gates / mapping are unchanged. - DR003: cross-ref the *-index lint follow-up to its new home (DR005). - README: list DR004 and DR005. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Docs i18n checklist
docs/pages/en/only (did not hand-editcn/kocontent)docs/sidebar.json(/en/) if pages were added, moved, or renamedcn/kotranslations committed to this PRcnandkonpm run i18n:checkreports 0 missing (stale warnings OK)