Skip to content

Add Playground markdown editor extension - #1

Merged
adamziel merged 1 commit into
mainfrom
markdown-editor
May 14, 2026
Merged

Add Playground markdown editor extension#1
adamziel merged 1 commit into
mainfrom
markdown-editor

Conversation

@adamziel

@adamziel adamziel commented May 14, 2026

Copy link
Copy Markdown
Owner

What it does

Adds markdown-editor/, a Playground-oriented extension for editing a host
directory of Markdown files through the WordPress block editor.

Rationale

The markdown editor pieces need to move as one unit. Keeping the mu-plugin,
sqlite_markdown PHP.wasm side-module source, and php-toolkit submodule in
this repository keeps the feature out of the Playground monorepo while still
making it easy to mount into Playground.

Implementation

The extension includes:

  • edit-markdown-mu-plugin.php, loaded as a mu-plugin
  • sqlite-markdown-extension/src, compiled with @php-wasm/compile-extension
  • vendor/php-toolkit, pinned as a submodule
  • specific Playground CLI setup and run instructions in
    markdown-editor/README.md

The current published @wp-playground/cli@3.1.30 is not enough for this
workflow. The README documents the source-checkout path that uses
WordPress/wordpress-playground#3524, and the shorter npx @wp-playground/cli@latest command to use after Playground publishes that
support.

Testing instructions

php -l markdown-editor/edit-markdown-mu-plugin.php
git diff --check HEAD~1...HEAD

Full runtime testing requires a Playground build with:

  • --php-extension support
  • PHP.wasm main modules exporting sqlite3_auto_extension() and
    sqlite3_cancel_auto_extension()

That support is tracked in
WordPress/wordpress-playground#3524.

@adamziel
adamziel merged commit e9823a0 into main May 14, 2026
@adamziel
adamziel deleted the markdown-editor branch May 14, 2026 15:14
adamziel added a commit to WordPress/wordpress-playground that referenced this pull request May 14, 2026
## What it does

Exports SQLite's `sqlite3_auto_extension()` and
`sqlite3_cancel_auto_extension()` symbols from PHP.wasm main modules.

## Rationale

External PHP.wasm side modules can register SQLite virtual table modules
by
calling `sqlite3_auto_extension()` during PHP startup. The markdown
editor now
lives in `adamziel/wp-extensions` and uses this path to register its
`markdown_posts` and `markdown_postmeta` virtual tables.

The current published `@wp-playground/cli@3.1.30` cannot run that
extension:
it does not expose the complete `--php-extension` workflow, and its
PHP.wasm
builds do not export these SQLite symbols. This PR is the
Playground-side
runtime change needed before the `wp-extensions` instructions can use a
published CLI release.

Related feature PR: adamziel/wp-extensions#1

## Implementation

Adds `sqlite3_auto_extension` and `sqlite3_cancel_auto_extension` to the
Asyncify export lists in:

- `packages/php-wasm/compile/php/Dockerfile`
- `packages/php-wasm/compile/php/Dockerfile-5-2`

The markdown-editor command, mu-plugin, SQLite extension source, and
`php-toolkit` submodule are intentionally not in this Playground PR.

## Testing instructions

```bash
git diff --check origin/trunk...HEAD
```

Full verification requires recompiling PHP.wasm and loading an external
side
module that calls `sqlite3_auto_extension()`. The consumer lives in
adamziel/wp-extensions#1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant