Skip to content

Commit 4a67ff3

Browse files
committed
Remove speculative source.type: "local" — no use case
The local source type (pre-rendered site directory) was scaffolded but never used. All screenshots use either example (render + serve) or url (live site). Removed from schema, capture.js routing, list.js display, and all documentation.
1 parent 26b21d3 commit 4a67ff3

7 files changed

Lines changed: 10 additions & 40 deletions

File tree

.claude/skills/screenshot/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Gather these parameters (ask about unknowns, infer from context when obvious):
4343

4444
| Parameter | Values / Notes |
4545
|-----------|---------------|
46-
| Source type | `url` (live site), `example` (local Quarto project), `local` (pre-rendered site directory) |
46+
| Source type | `url` (live site), `example` (Quarto project — render then serve) |
4747
| Source detail | URL, example project path (create minimal project if needed), or pre-rendered site path |
4848
| Viewport | navbar=1440x400, sidebar=992x600, about=1200x900, full page=1440x900 |
4949
| Zoom | Default 1.0; use 1.15 for about pages or excess internal padding |

.claude/skills/screenshot/manifest-schema.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,6 @@ Three source types:
8383
{ "type": "url", "url": "https://example.com/page.html" }
8484
```
8585

86-
**`local`** — an **already-rendered** site directory that capture.js will **serve only** (no rendering):
87-
```json
88-
{ "type": "local", "path": "_site", "page": "docs/websites/index.html" }
89-
```
90-
- `path` — path to the rendered site directory (relative to repo root)
91-
- `page` — HTML page within the site (optional, defaults to root)
92-
93-
Use `local` when you've already built the site (e.g., quarto-web's `_site/`) and just
94-
need to screenshot pages from it. Use `example` when capture.js should handle
95-
rendering the Quarto project.
96-
9786
### `capture`
9887

9988
All fields are optional. Missing fields inherit from `defaults` where applicable.

tools/screenshots/CLAUDE.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ then re-run `npm run capture`.
2424

2525
Use `/screenshot` to walk through the process:
2626

27-
1. Create or identify the source (example project in `examples/`, live URL, or local path)
27+
1. Create or identify the source (example project in `examples/` or live URL)
2828
2. Explore interactively with playwright-cli to determine viewport, element,
2929
interactions, and cleanup steps
3030
3. Encode the findings into a manifest.json entry
@@ -60,11 +60,9 @@ URLs still fail at runtime.
6060
Path conventions:
6161
- `output` — relative to repo root (e.g., `docs/websites/images/about-jolla.png`)
6262
- `source.project` — relative to `tools/screenshots/` (e.g., `examples/about-pages`)
63-
- `source.path` — relative to repo root (local source type, e.g., `_site`)
6463
- `doc.file` — relative to repo root
6564

66-
Source types: `example` (Quarto project — render then serve), `url` (live URL — no
67-
render/serve), `local` (already-rendered site directory — serve only, no render).
65+
Source types: `example` (Quarto project — render then serve), `url` (live URL).
6866

6967
## Dark Mode
7068

tools/screenshots/SETUP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Each screenshot in `manifest.json` specifies:
105105
- `name` — unique identifier
106106
- `output` — output PNG path (relative to repo root)
107107
- `dark` — if `true`, also captures a `-dark` variant (e.g. `about-jolla-dark.png`)
108-
- `source` — where to get the page (example project, URL, or local)
108+
- `source` — where to get the page (example project or URL)
109109
- `capture` — viewport, zoom, interactions, clip selectors, element selector
110110
- `doc` — which .qmd file references this image
111111

tools/screenshots/capture.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ function groupBySource(shots) {
107107
for (const s of shots) {
108108
const key = s.source.type === 'example'
109109
? s.source.project + (s.source.profile ? `:${s.source.profile}` : '')
110-
: s.source.type === 'url' ? `url:${s.source.url}`
111-
: `local:${s.source.path}`;
110+
: `url:${s.source.url}`;
112111
if (!groups.has(key)) groups.set(key, []);
113112
groups.get(key).push(s);
114113
}
@@ -435,13 +434,6 @@ async function main() {
435434
}
436435
} else if (shots[0].source.type === 'url') {
437436
baseUrl = shots[0].source.url;
438-
} else if (shots[0].source.type === 'local') {
439-
const siteDir = resolve(REPO_ROOT, shots[0].source.path);
440-
if (!dryRun) {
441-
server = await startServer(siteDir);
442-
baseUrl = server.url;
443-
console.log(` Serving ${siteDir} at ${baseUrl}`);
444-
}
445437
}
446438

447439
// Launch browser

tools/screenshots/manifest-schema.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,16 @@
132132
"properties": {
133133
"type": {
134134
"type": "string",
135-
"enum": ["example", "url", "local"],
136-
"description": "Source type: 'example' (local Quarto project), 'url' (live URL), 'local' (pre-rendered site path)."
135+
"enum": ["example", "url"],
136+
"description": "Source type: 'example' (Quarto project — render then serve), 'url' (live URL)."
137137
},
138138
"project": {
139139
"type": "string",
140140
"description": "Path to Quarto project relative to tools/screenshots/ (example type)."
141141
},
142142
"page": {
143143
"type": "string",
144-
"description": "HTML page within the rendered site (example/local types)."
144+
"description": "HTML page within the rendered site (example type)."
145145
},
146146
"profile": {
147147
"type": "string",
@@ -150,21 +150,13 @@
150150
"url": {
151151
"type": "string",
152152
"description": "Live URL to capture (url type)."
153-
},
154-
"path": {
155-
"type": "string",
156-
"description": "Path to a pre-rendered site directory (local type)."
157153
}
158154
},
159155
"if": { "properties": { "type": { "const": "example" } } },
160156
"then": { "required": ["type", "project"] },
161157
"else": {
162158
"if": { "properties": { "type": { "const": "url" } } },
163-
"then": { "required": ["type", "url"] },
164-
"else": {
165-
"if": { "properties": { "type": { "const": "local" } } },
166-
"then": { "required": ["type", "path"] }
167-
}
159+
"then": { "required": ["type", "url"] }
168160
}
169161
},
170162
"captureConfig": {

tools/screenshots/scripts/list.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ const filtered = namePattern
3131
console.log(`### ${filtered.length} screenshot(s) in manifest\n`);
3232
for (const s of filtered) {
3333
const src = s.source.type === 'example' ? s.source.project
34-
: s.source.type === 'url' ? s.source.url
35-
: s.source.path || s.source.page;
34+
: s.source.url;
3635
const vp = s.capture?.viewport || manifest.defaults.viewport;
3736
console.log(`- **${s.name}** → \`${s.output}\``);
3837
console.log(` Source: ${s.source.type} (${src})`);

0 commit comments

Comments
 (0)