diff --git a/documentation/README-SECTION-3-cli-commands.md b/documentation/README-SECTION-3-cli-commands.md index 8a6b133d2..5a9b69c74 100644 --- a/documentation/README-SECTION-3-cli-commands.md +++ b/documentation/README-SECTION-3-cli-commands.md @@ -60,34 +60,33 @@ The scripts these commands are grounded in (from this branch's `package.json`): "phone": "bun run apk:debug && bun run apk:install" ``` -`bun run build` writes the whole deployable tree to `public/doxa-maps/`, including -`manifest.json` — the machine-readable index that carries the ready-to-paste -**iframe** and **` + integrity="sha384-…" crossorigin="anonymous"> ``` -The element accepts props / emits events, so it can wire into a surrounding page as a -unified research dashboard (deploy-3 proof). The SRI hash regenerates on every build. +**The hash changes on every build**, so always copy it from the current `manifest.json`. The element +takes props and emits events, so it can wire into the surrounding page. -#### Embedding on a FOREIGN host (a partner site) — the two things that differ +**On a partner's site, a JS embed needs two values an iframe does not.** An iframe carries its own +document base; a script runs in the host's document, so relative asset and API paths would resolve +against the host and 404. The snippet already ships both: -Both embed methods were run to their first failure on a foreign host page (2026-09-20). -**deploy-1 needed nothing**; **deploy-3 needed two values**, and the snippet now ships both. - -*Why they differ:* an **iframe carries its own document base**, so the leaf page's relative -asset and API paths resolve correctly. A **direct-JS embed executes in the host's document**, -so those same relative paths resolve against the *host* — and 404. Same bundle, same data, -different containing document. - -| | iframe (deploy-1) | direct-JS (deploy-3) | +| | iframe | JavaScript embed | |---|---|---| -| `assetsBase` | not needed | **required** — in `profile-config` | -| API base | not needed | **required** — `window.MAP_APP_API_URL` (a host global, *not* a profile-config key) | -| Mapbox token | inherited by the leaf | replace `YOUR_MAPBOX_TOKEN` | +| `assetsBase` | not needed | **required**, in `profile-config` (`YOUR_TREE_URL/assets` until you set `assetsBaseUrl`) | +| API base | not needed | **required**, `window.MAP_APP_API_URL` (a host global) | +| Mapbox token | inherited by the leaf page | replace `YOUR_MAPBOX_TOKEN` | -Both are emitted into `embed.script` already: the API base uses the configured value, and -`assetsBase` falls back to a `YOUR_TREE_URL/assets` placeholder when `assetsBaseUrl` is unset. +### 4. WordPress / Disciple Tools — proof of concept -**One rewrite either way.** Snippet URLs are **tree-relative** (`./bundle/...`) because -`embedBaseUrl` is empty by default — that is what keeps a dropped folder position-independent -and the `check:drop` gate green. A partner whose page is not *at* the tree root must either -prefix the path (`./doxa-maps/...`) or set **`embedBaseUrl`** in the build config to emit -absolute URLs. That is a deployment choice, not a defect. +**No plugin needed for the simple path:** build, then paste the iframe or script snippet into a +WordPress **Custom HTML** block. -### 4. WordPress *(built + contract-proven; not yet shot on a live WP install)* - -> **Corrected 2026-09-20.** This section previously read *"deferred POC — no dedicated -> WordPress build step exists on this branch"*. That is no longer true: a first-class -> plugin exists at `deployment/wordpress/doxa-maps-embed/` (a `[doxa_map]` shortcode + a Gutenberg -> block), and its emitted markup is now verified by a gate. - -**The simple path** — no plugin needed, same artifacts as methods 1 and 3: - -```bash -BUILD_ALLOW=1 bun run build -``` - -Then paste either the iframe snippet **or** the `