Repository navigation
Conversation
Move the core-specific paths and handbook URLs into CORE_OPTIONS and export generateBlockDocs( options ). Running the script with no arguments produces the same output as before. Passing --blocks-dir (and optionally --source-url) documents another directory of blocks, writing only the block READMEs. Links between blocks resolve by block name instead of assuming the directory matches the name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…generator Blocks that define save in index.js instead of save.js were reported as "Unknown", and the markup section then called them static. Detect an inline save (ignoring save: () => null), and don't claim a block type when it is unknown. Core output is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 13, 2026
bor0
marked this pull request as ready for review
October 13, 2026 14:08
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Updated as activity occurs, without notifying anyone named here. Add the |
This branch has not been deployed
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.
What?
See #78998
Makes
tools/docs/generate-block-docs.mjswork on any directory of blocks, not justpackages/block-library/src. No change to the generated core docs.Why?
#78998 asks whether the per-block reference from #77612 could be reused by block plugins. This is a first step that doesn't commit to any public API: it only removes the core assumptions from the script, so where it should live for plugins (
@wordpress/scriptsor elsewhere) can be decided separately.How?
CORE_OPTIONS.generateBlockDocs( options )is exported, and running the script with no arguments usesCORE_OPTIONSas before.blockLink()assumed the directory equals the name minuscore/.{namespace}__{name}.html, which is the existing core naming.savedefined inindex.js(common in plugins), ignoringsave: () => null. When the type is still unknown, the markup section no longer calls the block static.--blocks-dirand--source-urlflags for trying it on a plugin. From the CLI, related blocks link to sibling READMEs.Testing Instructions
npm run docs:blocks-detail.git statusshows no changes outside this script./tmp/gatherpress/src/blocks/*/README.md, and nothing in the Gutenberg checkout changes.Sample output: gatherpress/dropdown-item (excerpt)
Known gaps, not addressed here:
<!-- wp:gatherpress/venue-detail {"fieldType":"text",...} /-->. The editor omits defaults when saving, so the real markup is shorter. This already happens for core blocks without fixtures.edit,saveandindex.php, which is core's file layout.Use of AI Tools
Written with Claude Code. I reviewed the change and checked the core output is unchanged.
🤖 Generated with Claude Code