docs: correct PageDocument contract description; drop stale chrome/sync sections
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
27e57b8837
commit
52f6c62fd3
@ -17,9 +17,12 @@ between first-party entities (cms, orchestrator, ninja CLI).
|
||||
the ABI hooks directly and never sees these Go structs.
|
||||
- **The SDK ships no page chrome.** A template renders only its
|
||||
`TemplateDocument`; the **host** composes the document envelope
|
||||
(doctype / `<html>` / `<head>` / `<body>` + bn chrome) around it. A guest
|
||||
expresses its envelope needs (title, meta, asset hooks) through
|
||||
`templates.PageDocument` — never by emitting head/body markup itself.
|
||||
(doctype / `<html>` / `<head>` / `<body>` + bn chrome) around it. Through
|
||||
`templates.PageDocument` a guest supplies the body plus envelope attributes
|
||||
(body class, `lang`, extra `<html>` attributes, and head/body-end extra
|
||||
HTML) — never head/body markup itself. Title, meta, and site chrome are
|
||||
host-authored: the host builds them from the doc map it also hands the guest
|
||||
as `doc_json`.
|
||||
|
||||
## Critical Rules
|
||||
|
||||
|
||||
14
README.md
14
README.md
@ -16,23 +16,15 @@ never the first-party `core` module.
|
||||
context rehydration), its capability stubs (`plugin/wasmguest/caps/`), and the
|
||||
`database/sql` driver over the host DB (`plugin/wasmguest/bnwasm/`).
|
||||
- **Guest-facing type packages** plugins consume: `blocks/` (incl. `blocks/builtin`,
|
||||
`blocks/shared`, `blocks/tags`), `templates/` (registry + `templates/pongo`),
|
||||
`templates/bn/` (the templ chrome — see sync rule below), `auth/`, `settings/`,
|
||||
`blocks/shared`, `blocks/tags`), `templates/` (the template registry + types,
|
||||
including `PageDocument` — the body-plus-envelope contribution a full-page
|
||||
template makes; the host owns the chrome), `auth/`, `settings/`,
|
||||
`content/`, `gating/`, `crypto/`, `rbac/`, `video/`, `ai/`, `subscriptions/`,
|
||||
`menus/`, `datasources/`.
|
||||
|
||||
The Go surface here is **one language binding**. The proto tree is the contract:
|
||||
a non-Go plugin implements the ABI hooks directly and never sees the Go structs.
|
||||
|
||||
## `templates/bn` synced-copy rule
|
||||
|
||||
`templates/bn/*` is **authored in the cms repo** (`cms/backend/templates/bn`) and
|
||||
**synced into here** via cms `make sync-templates`. Do not hand-edit the copy in
|
||||
this repo — edit it in cms and re-sync. Drift is enforced by check-safety **check 31**
|
||||
(`check-safety/check_templatesync.go`), which compares this repo's `templates/bn`
|
||||
against the cms authoritative copy. (This chrome is transitional: it is deleted from
|
||||
the SDK once host-side head/body injection lands — Phase 3.)
|
||||
|
||||
## Rules
|
||||
|
||||
- **NEVER use `replace` directives** in `go.mod`. Module resolution goes through the
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user