Preview a module as HTML
One module in one language as a page for the editor’s live preview, with the conditions inside it applied for variant. Read like every other module read: ?ref= may name a branch (a change set’s, for its author), and a module the reader may not see is 404, exactly like a missing one. The editor’s view: a page break shows as a marker labelled “Page break (PDF)”, and a text attribute ({product-name}), which a module on its own has no value for, as a chip with the attribute’s label, titled “Not set for this preview”.
bearerAuthorizationBearer <JWT>A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.
lang*string^[a-zA-Z]{2,3}(?:-[A-Za-z0-9]{2,8})*$id*string^[a-z0-9]+(?:-[a-z0-9]+)*$length <= 100variant?stringThe variant to apply the module’s conditions for, as a slug (model=large,software=2.3; attributes and values as configured). Default: none set, so a condition on a variant attribute does not hold.
length <= 500theme?stringColour scheme. auto (default) follows the viewer’s prefers-color-scheme; light and dark force one.
"auto""auto""light""dark"ref?stringBranch, tag or commit ID to read from. Default: the server's CCMS_DEFAULT_REF.
A complete HTML page (@openfolia/render-html) linking the theme and the renderer’s stylesheet, served with Content-Security-Policy (no script; styles, images and fonts from this origin; frame-ancestors this origin and CCMS_EDITOR_ORIGINS) and X-Content-Type-Options: nosniff. Images are GET /assets/:sha256 and safety symbols GET /symbols/:id (those with artwork; the configured label as the text alternative), at the same ?ref=. Cached like every content route.
response?stringtext/htmlcurl -X GET 'http://localhost:3000/modules/en/battery-charging/preview'"string"