docs: surface the runnable docs site from every entry point#256
Merged
Conversation
Now that the docs site at https://wordpress.github.io/php-toolkit/ ships runnable examples for every component, link to it from the places a reader is likely to land: * Repo description + homepage URL on github.com/WordPress/php-toolkit (set via the API to https://wordpress.github.io/php-toolkit/). * Root README.md gets a "📚 Live, runnable docs" callout at the top, a per-component table where each row links to both the README and the matching reference page on the live site, and a "build the docs site" section in the dev workflow. * Every components/<Name>/README.md gets an idempotent docs-site banner immediately under the H1, deep-linking to that component's reference page (https://wordpress.github.io/php-toolkit/reference/<slug>.html). * Every components/<Name>/composer.json gains a `homepage` field pointing at the same reference page, a `support` block with `issues`, `source`, and `docs` entries, and shared `keywords: [wordpress, php-toolkit]`. Packagist surfaces all of these on each package page, so readers landing on packagist.org/packages/wp-php-toolkit/zip can click straight through to the runnable docs. * The root composer.json (the meta-package wp-php-toolkit/php-toolkit) gets the same homepage + support block plus a description that names the docs URL. * examples/create-wp-site/README.md gets the same banner so readers who open the examples folder don't miss the docs site. * AGENTS.md gains a "Docs site:" pointer so coding agents know where the runnable examples live and that bin/_docs_components/<slug>.md is where to edit them. No code changes; all 87 snippets still pass `bin/run-snippets.py --check`. The 18 component banners are inserted via a simple marker (<!-- docs-site-banner --> ... <!-- /docs-site-banner -->), so future URL/wording updates can be reapplied idempotently.
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
The runnable docs site at https://wordpress.github.io/php-toolkit/ shipped in #244 and the markdown sources behind it landed in #254. This PR makes it easy to find from every place a reader is likely to land.
What changed
github.com/WordPress/php-toolkit— Repo description and homepage URL are set via API tohttps://wordpress.github.io/php-toolkit/, so the sidebar on the repo page surfaces the docs link.Root
README.md— A "📚 Live, runnable docs" callout sits at the top, a per-component table replaces the bullet list (each row links to both the README and the matching reference page on the live site), and a "Building the docs site" subsection in the dev workflow points atbin/build-docs-bundle.sh+bin/serve-docs.py.components/<Name>/README.md— All 18 component READMEs gain an idempotent banner immediately under the H1, deep-linking to that component's reference page. The banner is wrapped in HTML-comment markers so future URL/wording updates can be re-applied with one script:components/<Name>/composer.json— Each per-component package (17 of them;ToolkitCodingStandardshas no composer.json) gains:homepage→ the matching reference pagesupport: { issues, source, docs }→ links visible on Packagistkeywords: ["wordpress", "php-toolkit"]The result: someone who lands on https://packagist.org/packages/wp-php-toolkit/zip sees a "Homepage" link to the runnable docs and a "Documentation" link in the support sidebar.
Root
composer.json— Thewp-php-toolkit/php-toolkitmeta-package gets the same homepage + support block, plus a description that names the docs URL ("Browse runnable examples at https://wordpress.github.io/php-toolkit/").examples/create-wp-site/README.md— Same docs-site banner under the H1 so readers in the examples folder don't miss the docs site.AGENTS.md— ADocs site:pointer added next to the upstream/branch lines, with a one-liner thatbin/_docs_components/<slug>.mdis where the runnable examples live.Test plan
wp-php-toolkit/*page surfaces the docs URL under "Homepage" and "Documentation".🤖 Generated with Claude Code