docs(site): count imported code toward the code-block goal check - #3641
Merged
Conversation
A goal requirement of `pattern: '```'` counts backticks, and `<ImportContent mode="code">` renders a code block without any, so pages that import their examples score zero on a check they should pass. Every import-based example page fails it while an inline copy of the same snippet passes. That scoring is what produced the padding this repo has already had to fix twice: examples/javascript.mdx and examples/move.mdx each carried their intro sentence three times to clear a word-count goal, removed in #3637. The checks reward pasting a copy over importing the source, which is the opposite of the house preference. Each code import now counts as one complete fence pair, so importing a snippet never scores worse than pasting it. Counts only increase, so no page that passed before can start failing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WoBWxqLzd9hAxrhoqv3iSv
Contributor
|
Contributor
📋 afdocs check resultsURL: https://MystenLabs.github.io/walrus/pr-preview/pr-3641/ |
jessiemongeon1
approved these changes
Aug 17, 2026
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.
Description
A goal requirement of
pattern: '```'counts backticks in the body.<ImportContent … mode="code">renders a code block from a real source file without any backticks, so a page that imports its examples scores zero on a check it should pass, while an inline copy of the same snippet passes.Every import-based example page fails
Has code blocks for setup, source, and output: found 0, need >= 3today.Why this matters beyond the score
This scoring is what produced padding the repo has already had to fix.
examples/javascript.mdxandexamples/move.mdxeach carried their intro sentence three times, which #3637 removed:Those pages are one sentence plus an imported source file, so they could not clear
min_words: 100on their own. The checks reward pasting a copy over importing the source, which is the opposite of the house preference and the opposite of what review asks for.Change
Each
<ImportContent … mode="code">counts as one complete fence pair for the'```'pattern, so importing a snippet never scores worse than pasting it. The check is otherwise untouched.Test plan
node src/scripts/audit-docs.mjsfromdocs/site, before and after:examples/python.mdxexamples/walrus-relay.mdxexamples/browser-and-mobile.mdxexamples/javascript.mdxexamples/move.mdxexamples/checkpoint-data.mdxCounts only increase, so no page that passed before can start failing.
The three pages that still sit below the threshold of 3 on
mainreach it once their open PRs land, which is where their additional imports live:examples/javascript.mdxandexamples/checkpoint-data.mdxin #3627, andexamples/data-marketplace.mdxin #3626.Note on the related word-count check
min_wordshas the same blind spot: it measures prose, so an import-heavy page reads as short however good the imported code is. I have not changed it here, because unlike the fence count there is a real editorial argument that a page should carry enough prose to explain what its example does. The pages fixed in #3637 now clear it on real content rather than repetition. Raising it as a known adjacent issue rather than folding it into this change.Release notes