diff --git a/docs-migration-pr-plan.md b/docs-migration-pr-plan.md new file mode 100644 index 00000000000..cab0b9c1909 --- /dev/null +++ b/docs-migration-pr-plan.md @@ -0,0 +1,54 @@ +# Docs Migration PR Plan + +Tracking issue: https://github.com/WordPress/wordpress-playground/issues/3497 + +## Current Status + +- Phase 1 groundwork is merged in PRs #3466, #3467, #3470, and #3496. +- This follow-up migration removes remaining heading IDs and fragment references. +- Docusaurus callouts have been replaced with Handbook-compatible raw HTML callouts. +- Translation source comments are preserved; active callout markers are converted so + scans that target rendered directives stay clean. + +## Recommended PR Split + +1. Translation heading ID cleanup + - Remove remaining translated heading IDs. + - Verify with `rg '\{#[^}]+\}' packages/docs/site/docs packages/docs/site/i18n`. + +2. Translation fragment cleanup + - Inline remaining `APIList` and `ThisIsQueryApi` references. + - Verify with `rg '(_fragments|`. + - Convert Markdown links inside touched callouts to HTML anchors. + +4. English warning and caution callouts + - Convert English `warning`, `caution`, and equivalent danger callouts to + `
`. + - Preserve titles as bold first lines. + +5. English tip callouts + - Convert English `tip` callouts to `
`. + - Keep the local `.callout-tip` Docusaurus fallback style in `custom.css`. + +6. Translation callout parity + - Convert translated info, warning, caution, note, danger, and tip callouts. + - Suggested batches: `es + fr`, `pt-BR`, `ja`, then `bn + gu + hi + it + tl`. + +## Verification + +- `rg '\{#[^}]+\}' packages/docs/site/docs packages/docs/site/i18n` +- `rg '(_fragments| + In Javascript, you can get a compact version of any blueprint JSON with [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) and [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) Example: @@ -49,7 +50,7 @@ const encodedBlueprint = encodeURIComponent(minifiedBlueprintJson); const playgroundUrl = `https://playground.wordpress.net/#${encodedBlueprint}`; ``` -::: +
You won't have to paste links to follow along. We'll use code examples with a "Try it out" button that will automatically run the examples for you: @@ -96,7 +97,8 @@ const playgroundUrl = `https://playground.wordpress.net/#${encodeURIComponent(JS If another tool changes URL fragments, use a Base64-encoded Blueprint instead. -:::tip +
+ In JavaScript, You can get any blueprint JSON in [Base64 format](https://developer.mozilla.org/en-US/docs/Glossary/Base64#javascript_support) with global function `btoa()`. Example: @@ -112,7 +114,7 @@ const blueprintJson = `{ const minifiedBlueprintJson = btoa(blueprintJson); // eyIkc2NoZW1hIjogImh0dHBzOi8vcGxheWdyb3VuZC53b3JkcHJlc3MubmV0L2JsdWVwcmludC1zY2hlbWEuanNvbiIsInByZWZlcnJlZFZlcnNpb25zIjogeyJwaHAiOiAiNy40Iiwid3AiOiAiNi41In19 ``` -::: +
### Load Blueprint from a URL diff --git a/packages/docs/site/docs/blueprints/05-steps.md b/packages/docs/site/docs/blueprints/05-steps.md index 52a890010e0..64621491d32 100644 --- a/packages/docs/site/docs/blueprints/05-steps.md +++ b/packages/docs/site/docs/blueprints/05-steps.md @@ -24,15 +24,17 @@ Each step is an object that contains a `step` property that specifies the type o The following step-related topics are addressed on dedicated pages included in this section: -- [Resources References](/blueprints/steps/resources) allow you use external files in Blueprints. +- [Resources References](/blueprints/steps/resources) allow you use external files in Blueprints. -- Some steps have a shorthand version. Check the [Shorthands](/blueprints/steps/shorthands) section for more information about them. +- Some steps have a shorthand version. Check the [Shorthands](/blueprints/steps/shorthands) section for more information about them. -- For each step listed below, you'll find both a "Blueprint API" and a "Function API". Refer to the [API Consistency](/blueprints/steps/api-consistency) page for further details. +- For each step listed below, you'll find both a "Blueprint API" and a "Function API". Refer to the [API Consistency](/blueprints/steps/api-consistency) page for further details. + +
-:::tip The [WordPress Playground Step Library](https://akirk.github.io/playground-step-library/#) tool provides a visual interface to drag or click the steps to create a blueprint for WordPress Playground. You can also [create your own steps](https://github.com/akirk/playground-step-library/#contributing)! -::: + +
--- diff --git a/packages/docs/site/docs/blueprints/07-json-api-and-function-api.md b/packages/docs/site/docs/blueprints/07-json-api-and-function-api.md index fa7ab0bffa1..b32b7429a36 100644 --- a/packages/docs/site/docs/blueprints/07-json-api-and-function-api.md +++ b/packages/docs/site/docs/blueprints/07-json-api-and-function-api.md @@ -29,6 +29,8 @@ There are two main differences between the JSON and Function APIs: 1. Blueprints handle the progress bar and error reporting for you. The function API requires you to handle these yourself. 2. The function API requires importing the API client library while Blueprints may be just pasted into the URL fragment. -:::note +
+ Check the [Use the same structure for Blueprint JSON definitions and step handlers](https://github.com/WordPress/wordpress-playground/pull/215) issue at [wordpress-playground](https://github.com/WordPress/wordpress-playground) repo for more detailed info about this topic -::: + +
diff --git a/packages/docs/site/docs/blueprints/08-examples.md b/packages/docs/site/docs/blueprints/08-examples.md index fdb931b0892..bf409832744 100644 --- a/packages/docs/site/docs/blueprints/08-examples.md +++ b/packages/docs/site/docs/blueprints/08-examples.md @@ -9,9 +9,11 @@ import BlueprintExample from '@site/src/components/Blueprints/BlueprintExample.m # Blueprints Examples -:::tip +
+ Check the [Blueprints Gallery](https://github.com/WordPress/blueprints/blob/trunk/GALLERY.md) to explore real-world code examples of using WordPress Playground to launch a WordPress site with a variety of setups. -::: + +
Let's see some cool things you can do with Blueprints. @@ -122,9 +124,11 @@ You can run WP-CLI commands on a Playground instance either from your terminal o To use your terminal, you must first mount the `/wordpress/` directory and ensure the SQLite database integration is configured. This is because Playground's internal database doesn't persist on a mounted site, so you must explicitly install the database plugin via a Blueprint. This allows WP-CLI to recognize the WordPress installation and connect to its database. -:::note +
+ If you run WP-CLI commands as steps within your Blueprint file, this manual setup is not needed. -::: + +
The following Blueprint snippet handles this setup: diff --git a/packages/docs/site/docs/blueprints/09-troubleshoot-and-debug-blueprints.md b/packages/docs/site/docs/blueprints/09-troubleshoot-and-debug-blueprints.md index 0f2f5975e23..c0cef946b47 100644 --- a/packages/docs/site/docs/blueprints/09-troubleshoot-and-debug-blueprints.md +++ b/packages/docs/site/docs/blueprints/09-troubleshoot-and-debug-blueprints.md @@ -424,12 +424,14 @@ npx @wp-playground/cli server --mount-before-install=wordpress:/wordpress --blue Use the in-browser [Blueprints editor](https://playground.wordpress.net/builder/builder.html) to build, validate, and preview Blueprints. -:::danger Caution +
+ +**Caution** The editor is under development and the embedded Playground sometimes fails to load. To get around it, refresh the page. -::: +
### Filesystem and database inspection @@ -458,12 +460,14 @@ Open browser developer tools to check JavaScript errors, PHP debug logs, and failed network requests. In Chrome, Firefox, and Edge, press `Ctrl + Shift + I` on Windows/Linux or `Cmd + Option + I` on macOS. -:::caution Safari +
+ +**Safari** If you have not enabled the Develop menu, go to **Safari > Settings... > Advanced** and check **Show features for web developers**. -::: +
### Custom error logging @@ -473,11 +477,13 @@ You can write your own messages with `error_log()` in a ![Log errors snapshot](https://raw.githubusercontent.com/WordPress/wordpress-playground/refs/heads/trunk/packages/docs/site/static/img/blueprints/log-errors.webp) -:::info +
+ When you download your Playground instance as a ZIP through the ["Download as zip"](/web-instance) option, the archive also includes `debug.log`. -::: + +
## Ask for help diff --git a/packages/docs/site/docs/blueprints/intro.md b/packages/docs/site/docs/blueprints/intro.md index cf28a7f0a87..4d46fba8b19 100644 --- a/packages/docs/site/docs/blueprints/intro.md +++ b/packages/docs/site/docs/blueprints/intro.md @@ -9,9 +9,11 @@ import BlueprintExample from '@site/src/components/Blueprints/BlueprintExample.m # Blueprints Docs -:::tip +
+ Check the [Blueprints Gallery](https://github.com/WordPress/blueprints/blob/trunk/GALLERY.md) to explore real-world code examples of using WordPress Playground to launch a WordPress site with a variety of setups. -::: + +
Hi! Welcome to WordPress Playground Blueprints documentation. @@ -19,27 +21,27 @@ Blueprints are JSON files for setting up your very own WordPress Playground inst

The WordPress Playground documentation is distributed across four separate hubs (subsites):

-- [**Documentation**](/) – Introduction to WP Playground, starter guides and your entry point to WP Playground Docs. -- 👉 [**Blueprints**](/blueprints) (you're here) – Blueprints are JSON files for setting up your WordPress Playground instance. Learn about their possibilities from this Blueprints docs hub. -- [**Developers**](/developers) – WordPress Playground was created as a programmable tool. Discover all the things you can do with it from your code in the Developers docs hub. -- [**API Reference**](/api) – All the APIs exposed by WordPress Playground +- [**Documentation**](/) – Introduction to WP Playground, starter guides and your entry point to WP Playground Docs. +- 👉 [**Blueprints**](/blueprints) (you're here) – Blueprints are JSON files for setting up your WordPress Playground instance. Learn about their possibilities from this Blueprints docs hub. +- [**Developers**](/developers) – WordPress Playground was created as a programmable tool. Discover all the things you can do with it from your code in the Developers docs hub. +- [**API Reference**](/api) – All the APIs exposed by WordPress Playground ## Navigating the Blueprints documentation hub This docs hub is focused on Blueprints info and is divided into the following major sections: -- [Getting started with Blueprints](/blueprints/getting-started): Quick Start Guide to setting up a WordPress Playground instance using Blueprint JSON files. +- [Getting started with Blueprints](/blueprints/getting-started): Quick Start Guide to setting up a WordPress Playground instance using Blueprint JSON files. -- [Tutorial - Blueprints 101](/blueprints/tutorial) - Blueprints API crash course. The tutorial will guide you through the complete process of creating a blueprint that loads a theme and plugin (among other things). +- [Tutorial - Blueprints 101](/blueprints/tutorial) - Blueprints API crash course. The tutorial will guide you through the complete process of creating a blueprint that loads a theme and plugin (among other things). -- [Blueprint data Format](/blueprints/data-format): Blueprint JSON files define your Playground instance with various properties. This section highlights the key properties you need to know. +- [Blueprint data Format](/blueprints/data-format): Blueprint JSON files define your Playground instance with various properties. This section highlights the key properties you need to know. -- [Using Blueprints](/blueprints/using-blueprints): Learn in this section different ways to use Blueprints. +- [Using Blueprints](/blueprints/using-blueprints): Learn in this section different ways to use Blueprints. -- [Steps](/blueprints/steps): API Reference of all the available steps that can be set in a blueprint to run tasks such as login, plugin/theme activation, file operations, and more. +- [Steps](/blueprints/steps): API Reference of all the available steps that can be set in a blueprint to run tasks such as login, plugin/theme activation, file operations, and more. -- [Blueprint Bundles](/blueprints/bundles): Learn how to create and use Blueprint bundles - self-contained packages that include a Blueprint and all its resources. +- [Blueprint Bundles](/blueprints/bundles): Learn how to create and use Blueprint bundles - self-contained packages that include a Blueprint and all its resources. -- [Examples](/blueprints/examples): Compilation of Blueprint examples for various WordPress Playground setups, including installing themes/plugins, running PHP code, enabling features, and loading specific WordPress versions. +- [Examples](/blueprints/examples): Compilation of Blueprint examples for various WordPress Playground setups, including installing themes/plugins, running PHP code, enabling features, and loading specific WordPress versions. -- [Troubleshoot and debug Blueprints](/blueprints/troubleshoot-and-debug): Tips and tools for troubleshooting and debugging Blueprints. +- [Troubleshoot and debug Blueprints](/blueprints/troubleshoot-and-debug): Tips and tools for troubleshooting and debugging Blueprints. diff --git a/packages/docs/site/docs/blueprints/tutorial/03-build-your-first-blueprint.md b/packages/docs/site/docs/blueprints/tutorial/03-build-your-first-blueprint.md index dc012fec1b3..79401d5e926 100644 --- a/packages/docs/site/docs/blueprints/tutorial/03-build-your-first-blueprint.md +++ b/packages/docs/site/docs/blueprints/tutorial/03-build-your-first-blueprint.md @@ -25,7 +25,9 @@ It may seem like nothing is happening, but this Blueprint already spins up a Wor [   Run Blueprint   ](https://playground.wordpress.net/#{}) -:::tip **Autocomplete** +
+ +**Autocomplete** If you use an IDE, like VS Code or PHPStorm, you can use the [Blueprint JSON Schema](https://playground.wordpress.net/blueprint-schema.json) for an autocompleted Blueprint development experience. Add the following line at the top of your `blueprint.json` file: @@ -35,7 +37,7 @@ If you use an IDE, like VS Code or PHPStorm, you can use the [Blueprint JSON Sch } ``` -::: +
Here's what it looks like in VS Code: ![Autocompletion visualized](https://raw.githubusercontent.com/WordPress/wordpress-playground/refs/heads/trunk/packages/docs/site/static/img/blueprints/schema-autocompletion.webp) @@ -129,9 +131,11 @@ The example uses the `wordpress.org/themes` resource, which requires a `slug` id In this case, `https://wordpress.org/themes//` becomes `https://wordpress.org/themes/adventurer/`. -:::note +
+ Learn more about the supported resources in the [Blueprint Resources API Reference](/blueprints/steps/resources/). -::: + +
## 4. Install the _Hello Dolly_ plugin diff --git a/packages/docs/site/docs/blueprints/tutorial/index.md b/packages/docs/site/docs/blueprints/tutorial/index.md index 0b50af8d132..8220e4e6b7d 100644 --- a/packages/docs/site/docs/blueprints/tutorial/index.md +++ b/packages/docs/site/docs/blueprints/tutorial/index.md @@ -13,6 +13,8 @@ Welcome to a Blueprints crash course, where you'll find everything you need to k 2. [How to load and run Blueprints](/blueprints/tutorial/how-to-load-run-blueprints) 3. [Build your first Blueprint](/blueprints/tutorial/build-your-first-blueprint) -:::tip +
+ If you encounter any issues while following this tutorial, refer to the [Troubleshoot and debug Blueprints](/blueprints/troubleshoot-and-debug) section for tips and tools to help you solve them. -::: + +
diff --git a/packages/docs/site/docs/developers/03-build-an-app/01-index.md b/packages/docs/site/docs/developers/03-build-an-app/01-index.md index 8bbafe94625..1d934c0666d 100644 --- a/packages/docs/site/docs/developers/03-build-an-app/01-index.md +++ b/packages/docs/site/docs/developers/03-build-an-app/01-index.md @@ -22,13 +22,15 @@ Playground can be embedded on your website using the HTML `