Files
faunosteo/docs/design/v1-2-4/render.cjs
T
bchanot f00d8b4e4c docs(docs): V1-2.4 maquettes proposal, verification worker risk register
docs/design/v1-2-4: twelve functional mockups on the existing identity
(catalogue, editor, narrow read-only, verification states, review, admin
navigation, FR/EN labels), not validated. V1-2 contract §13.1: accepted risks
VR-1 (CPU contention, MEDIUM) to VR-5 with their re-examination condition.
2026-11-02 00:11:04 +01:00

20 lines
920 B
JavaScript

// node render.cjs <html> <out-dir>: one PNG per [data-board] element, plus the full page (all.png).
// PW_MODULE = the absolute path of apps/app/node_modules/@playwright/test (the pinned Chromium).
const path = require('path')
const { chromium } = require(process.env.PW_MODULE)
;(async () => {
const [html, out] = process.argv.slice(2)
const browser = await chromium.launch()
const page = await browser.newPage({ viewport: { width: 1400, height: 900 }, deviceScaleFactor: 1 })
await page.goto('file://' + path.resolve(html))
await page.waitForLoadState('networkidle')
const boards = await page.$$('[data-board]')
for (const b of boards) {
const name = await b.getAttribute('data-board')
await b.screenshot({ path: path.join(out, name + '.png') })
}
await page.screenshot({ path: path.join(out, 'all.png'), fullPage: true })
await browser.close()
console.log('boards', boards.length)
})()