You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
capture.js now automatically generates -dark variants for screenshots
with "dark": true in manifest. Dark mode is activated by clicking the
Quarto color scheme toggle (.quarto-color-scheme-toggle). For clip
screenshots, the clip region is computed as the union of light and dark
bounding boxes so both variants have identical dimensions.
- Add light/dark theme (cosmo/darkly) to example _quarto.yml files
- Add defaults.dark config to manifest (toggle selector, ready check)
- Update all docs: CLAUDE.md, SETUP.md, capture agent, screenshot command
- Tighten about-jolla viewport to 650px to reduce bottom whitespace
Copy file name to clipboardExpand all lines: tools/screenshots/SETUP.md
+15-10Lines changed: 15 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,18 @@ Tooling for capturing and maintaining documentation screenshots in quarto-web.
4
4
5
5
## Prerequisites
6
6
7
-
-**Node.js 18+** — required for scripts and playwright-cli
7
+
-**Node.js 18+** — required for scripts and Playwright
8
8
-**Quarto** — required for rendering example projects (set `QUARTO_CMD` env var if your binary has a different name)
9
9
10
10
## Option A: Automated Replay (no AI)
11
11
12
12
```bash
13
-
# One-time: install playwright-cli and browser
14
-
npm install -g @playwright/cli@latest
15
-
playwright-cli install-browser
13
+
# One-time: install dependencies and browser
14
+
cd tools/screenshots
15
+
npm install
16
+
npx playwright install chromium
16
17
17
-
#From tools/screenshots/:
18
+
#Capture all screenshots (light + dark variants):
18
19
npm run capture # all screenshots
19
20
npm run capture -- --name navbar-tools # specific
20
21
npm run capture -- --name "about-*"# glob pattern
@@ -73,27 +74,31 @@ A CI workflow compresses changed PNGs after merge to main. Local install is opti
73
74
```
74
75
tools/screenshots/
75
76
├── manifest.json # screenshot definitions (single source of truth)
76
-
├── capture.js # replay script (no AI)
77
-
├── package.json # type:module, npm scripts
77
+
├── capture.js # replay script (uses Playwright API directly)
78
+
├── package.json # dependencies: playwright, open
78
79
├── CLAUDE.md # visual rules for Claude
79
80
├── SETUP.md # this file
80
81
├── scripts/
81
82
│ ├── list.js # read + format manifest
82
83
│ ├── render.js # quarto render wrapper
83
84
│ ├── serve.js # static file server
85
+
│ ├── open.js # open file with OS default app
84
86
│ └── compress.js # oxipng wrapper
85
87
└── examples/
86
-
├── about-pages/ # about page templates
87
-
└── navbar-tools/ # navbar with dropdown
88
+
├── about-pages/ # about page templates (light + dark theme)
89
+
└── navbar-tools/ # navbar with dropdown (light + dark theme)
88
90
```
89
91
90
92
## Manifest Format
91
93
92
94
Each screenshot in `manifest.json` specifies:
93
95
-`name` — unique identifier
94
96
-`output` — output PNG path (relative to repo root)
97
+
-`dark` — if `true`, also captures a `-dark` variant (e.g. `about-jolla-dark.png`)
95
98
-`source` — where to get the page (example project, URL, or local)
96
-
-`capture` — viewport, interactions, element selector
99
+
-`capture` — viewport, interactions, clip selectors, element selector
97
100
-`doc` — which .qmd file references this image
98
101
102
+
Dark mode works by clicking the Quarto color scheme toggle (`.quarto-color-scheme-toggle`). Example projects must have `theme: { light: cosmo, dark: darkly }` in `_quarto.yml`.
0 commit comments