Skip to content

Commit 8992fe7

Browse files
TMHSDigitalclaude
andcommitted
docs: per-example detail pages in the gallery
Each example now gets docs/gallery/<name>/index.html: the hero render with a click-to-zoom lightbox, the witnesses callout, a copyable run-it-yourself command, the README rendered inline (relative links resolve to GitHub), and the full Python source syntax-highlighted at build time via stdlib tokenize — no new dependencies, the stdlib-only rule for build_gallery.py holds. The gallery index gains topic filter chips driven by an additive tags field in gallery.json, and cards now link to the detail pages instead of straight to GitHub. pages.yml rebuilds on any examples/** change so embedded source and READMEs can never drift. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 3679858 commit 8992fe7

8 files changed

Lines changed: 2148 additions & 92 deletions

File tree

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
- "site.json"
1818
- ".cursor-plugin/plugin.json"
1919
- "assets/**"
20-
- "examples/gallery.json"
20+
- "examples/**"
2121
- "docs/gallery/**"
2222
- "scripts/build_gallery.py"
2323
- "scripts/site/**"

docs/gallery/depsgraph-export/index.html

Lines changed: 313 additions & 0 deletions
Large diffs are not rendered by default.

docs/gallery/gn-sdf-remesh/index.html

Lines changed: 387 additions & 0 deletions
Large diffs are not rendered by default.

docs/gallery/index.html

Lines changed: 108 additions & 20 deletions
Large diffs are not rendered by default.

docs/gallery/swatch-grid/index.html

Lines changed: 485 additions & 0 deletions
Large diffs are not rendered by default.

docs/gallery/turntable/index.html

Lines changed: 389 additions & 0 deletions
Large diffs are not rendered by default.

examples/gallery.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"_comment": "FORWARD-COMPATIBLE SOURCE OF TRUTH for the examples gallery. The local page at docs/gallery/index.html is GENERATED from this file by scripts/build_gallery.py -- do not hand-edit the HTML. When the fleet template (Developer-Tools-Directory: site-template/build_site.py + template.html.j2) gains examples support (see ROADMAP: 'Fleet Pages examples support'), it reads this same file and the local page is retired. That migration is a lift-and-shift, not a rewrite: keep this schema stable. Per-entry schema: {name, dir, teaches, witnessesFix, hero, preview}; hero/preview/dir are repo-root-relative.",
2+
"_comment": "FORWARD-COMPATIBLE SOURCE OF TRUTH for the examples gallery. The local page at docs/gallery/index.html is GENERATED from this file by scripts/build_gallery.py -- do not hand-edit the HTML. When the fleet template (Developer-Tools-Directory: site-template/build_site.py + template.html.j2) gains examples support (see ROADMAP: 'Fleet Pages examples support'), it reads this same file and the local page is retired. That migration is a lift-and-shift, not a rewrite: keep this schema stable. Per-entry schema: {name, dir, teaches, witnessesFix, hero, preview, tags?}; hero/preview/dir are repo-root-relative; tags is an optional additive list driving the gallery filter chips. build_gallery.py also emits a detail page per example at docs/gallery/<name>/.",
33
"title": "Examples Gallery",
44
"description": "Runnable, smoke-gated Blender Python examples — each executed headless on Blender 4.5 LTS and 5.1, so every render reflects code that actually runs.",
55
"repoBaseUrl": "https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main",
@@ -11,31 +11,35 @@
1111
"teaches": "Procedural Principled materials — metal and dielectric, the emission pattern, and the cross-version set_specular shim.",
1212
"witnessesFix": "EEVEE engine-id mapping: BLENDER_EEVEE on 5.x, BLENDER_EEVEE_NEXT on 4.2–4.5.",
1313
"hero": "docs/gallery/assets/swatch-grid-hero.webp",
14-
"preview": "examples/swatch-grid/preview.webp"
14+
"preview": "examples/swatch-grid/preview.webp",
15+
"tags": ["materials", "rendering"]
1516
},
1617
{
1718
"name": "turntable",
1819
"dir": "examples/turntable",
1920
"teaches": "A slotted-actions Z-rotation turntable keyed through the cross-version channelbag path (get_channelbag_for_slot).",
2021
"witnessesFix": "Slotted-actions boundary: ensure-helper channelbag on 5.x, strip.channelbag on 4.4/4.5.",
2122
"hero": "docs/gallery/assets/turntable-hero.webp",
22-
"preview": "examples/turntable/preview.webp"
23+
"preview": "examples/turntable/preview.webp",
24+
"tags": ["animation"]
2325
},
2426
{
2527
"name": "gn-sdf-remesh",
2628
"dir": "examples/gn-sdf-remesh",
2729
"teaches": "A Geometry Nodes SDF remesh (MeshToSDFGrid → GridToMesh at the SDF zero-level), with a Set Material node carrying the material through the remesh.",
2830
"witnessesFix": "An SDF grid is meshed with Grid to Mesh, not Volume to Mesh; GN geometry needs Set Material or it renders untextured.",
2931
"hero": "docs/gallery/assets/gn-sdf-remesh-hero.webp",
30-
"preview": "examples/gn-sdf-remesh/preview.webp"
32+
"preview": "examples/gn-sdf-remesh/preview.webp",
33+
"tags": ["geometry-nodes", "materials"]
3134
},
3235
{
3336
"name": "depsgraph-export",
3437
"dir": "examples/depsgraph-export",
3538
"teaches": "The depsgraph lifetime contract — evaluated_get().to_mesh() paired with to_mesh_clear() — measured against an OBJ export of the same object.",
3639
"witnessesFix": "Exports ship evaluated geometry: the exported vertex count equals the subsurf-applied count and is strictly greater than the base mesh.",
3740
"hero": "docs/gallery/assets/depsgraph-export-hero.webp",
38-
"preview": "examples/depsgraph-export/preview.webp"
41+
"preview": "examples/depsgraph-export/preview.webp",
42+
"tags": ["depsgraph", "export"]
3943
}
4044
]
4145
}

scripts/build_gallery.py

Lines changed: 456 additions & 66 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)