OpenFolia

Preview a page design template as a page image

GET
/page-design-templates/{templateId}/preview/pages/{page}.png

One page of a small manual that uses every function of the template contract (running text with each inline mark, every safety severity and admonition, steps, a list, a table, a section, an FAQ entry), laid out with the template templateId at ?ref= (#396), as PNG: the template screen’s live preview. With workingCopy=true (the change set’s author) the working copies of the template’s files stand in for theirs. ?design= lays it out with that page design’s settings (its colours, fonts, logo, regions); the built-in design’s by default. The template compiles in the renderer’s sandbox (its own folder’s files and the design’s files only, nothing of the host or the network, within the time and memory limits). Sent with nosniff and a sandboxing Content-Security-Policy.

Authorization

bearer
headerAuthorizationBearer <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.

Path Parameters

templateId*string

The template’s folder name (templates/<templateId>/).

Match^[a-z0-9]+(?:-[a-z0-9]+)*$
Lengthlength <= 100
page*string

The page, from 1 (the title page) to 9999.

Match^[1-9][0-9]{0,3}$

Query Parameters

width?string

The image’s width in pixels (16–2400, default 480); the height follows the page.

Match^[0-9]{1,4}$
design?string

The page design (design/<id>.yaml at ref, its working copy with workingCopy=true) whose settings lay the probe out; the template replaces its own. Default: the built-in design.

Match^[a-z0-9]+(?:-[a-z0-9]+)*$
Lengthlength <= 100
workingCopy?string

For authors (left out of the delivery document): true reads the change set’s working copies (what its editor autosaved, not committed yet) in place of their files, modules and manuals alike; module references resolve to their own working copies where there are any; an image uploaded into the change set links to GET /change-sets/{changeSetId}/assets/{hash} in an HTML page, and the PDF shows it. Needs ref to name the change set’s branch (change-sets/<id>; else 400 invalid-parameter) and only for its author: 403 for anyone else who may read drafts, 404 for anyone who may not. private, no-cache, without the commit’s ETag. Default: false.

Default"false"
Value in"true""false"
ref?string

Branch, tag or commit ID to read from. Default: the server's CCMS_DEFAULT_REF.

Header Parameters

X-Ccms-User?string

Demo mode only (CCMS_AUTH_MODE=demo): the user ID to act as. The bearer token is still required; without demo mode the header is refused (400).

Response Body

The page as PNG.

response?unknownimage/png
Example Request
curl -X GET 'http://localhost:3000/page-design-templates/house/preview/pages/1.png'
Example Response
null