Skip to content

docs: surface the runnable docs site from every entry point#256

Merged
adamziel merged 1 commit into
trunkfrom
docs-discoverability
May 3, 2026
Merged

docs: surface the runnable docs site from every entry point#256
adamziel merged 1 commit into
trunkfrom
docs-discoverability

Conversation

@adamziel
Copy link
Copy Markdown
Collaborator

@adamziel adamziel commented May 3, 2026

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 to https://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 at bin/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:

<!-- docs-site-banner -->
> 📚 **Runnable examples:** [https://wordpress.github.io/php-toolkit/reference/zip.html](...)
> Open the page to edit each snippet in your browser and run it in WordPress Playground.
<!-- /docs-site-banner -->

components/<Name>/composer.json — Each per-component package (17 of them; ToolkitCodingStandards has no composer.json) gains:

  • homepage → the matching reference page
  • support: { issues, source, docs } → links visible on Packagist
  • shared keywords: ["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 — The wp-php-toolkit/php-toolkit meta-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 — A Docs site: pointer added next to the upstream/branch lines, with a one-liner that bin/_docs_components/<slug>.md is where the runnable examples live.

Test plan

  • CI passes (no code changes; 87/87 snippets still match).
  • After merge, https://github.com/WordPress/php-toolkit shows the homepage URL on the right sidebar.
  • After Packagist re-sync (auto on next release, or manual via the package page), each wp-php-toolkit/* page surfaces the docs URL under "Homepage" and "Documentation".
  • Component READMEs render the banner cleanly on github.com (HTML-comment markers stay invisible).

🤖 Generated with Claude Code

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.
@adamziel adamziel merged commit 2e18d34 into trunk May 3, 2026
28 of 29 checks passed
@adamziel adamziel deleted the docs-discoverability branch May 3, 2026 19:38
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.

1 participant