feat(pipeline): InDesign output generator — FSE patterns, templates & theme.json writer (#65)#92
Merged
PAMulligan merged 1 commit intoMay 30, 2026
Conversation
Add the output generator — stage 4 of the InDesign-to-WordPress pipeline. It takes a parsed IR (#62/#63) plus the mapped design tokens (#64) and emits a complete, installable Flavian-compatible FSE theme: - one block pattern per spread under an "InDesign Imports" category - frames → core blocks (heading/paragraph/group, image/cover, columns) referencing token slugs, never inline values - header/footer parts derived from master-spread chrome (web defaults otherwise), index/page/404 templates, the merged theme.json - staged-asset plan + bin/import-media.sh (+ optional bin/seed-content.sh) - indesign-pipeline-report.md enumerating files, unmapped nodes, follow-ups generateTheme() is pure and deterministic — same IR yields byte-identical files, so reruns never churn. Exposed via the new flavian-generate-theme CLI (composes with the parser CLIs or parses .idml/.pdf directly). Tests: schema-valid theme.json, one pattern per spread, token references resolve, deterministic reruns, and markup snapshots for a text-heavy and an image-heavy spread. Also registers the existing flavian-map-tokens bin. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sub-issue of #61. Implements stage 4 of the InDesign-to-WordPress pipeline: take the parsed IR (#62/#63) and mapped design tokens (#64) and emit the actual WordPress artifacts — a complete, installable Flavian-compatible FSE theme.
What it does
generateTheme(ir, options)→ a full theme directory (pure & deterministic, no fs/clock/randomness in the core):core/heading/core/paragraph, grouped incore/group(role from the paragraph style name:Heading N,Body,Caption…)core/image, orcore/coverwhen text is overlaid on the imagecore/columnsheader.html/footer.htmlderived from master-spread chrome (web-appropriate defaults when no usable master)index.html(stitches the spread patterns between header/footer),page.html,404.htmlbin/import-media.sh; optionalbin/seed-content.sh(--seed-content)indesign-pipeline-report.mdenumerating produced files, unmapped IR nodes, and manual follow-upsExposed via a new
flavian-generate-themeCLI that composes with the parser CLIs or parses.idml/.pdfdirectly. Image URLs resolve throughget_theme_file_uri()(pattern-first — no brokensrc="").Acceptance criteria
.idmlproduces a theme dir that loads in the Site Editor without PHP errorsfunctions.php)theme.jsonround-trips through validation (it's the mapper's already-validatedmergedoutput; a test also asserts every slug referenced in patterns exists intheme.json)tests/indesign/__snapshots__/)Tests
pnpm --filter @flavian/pipeline test→ 99 passing (88 prior + 11 new). Snapshots re-record withUPDATE_SNAPSHOTS=1.Notes
packages/pipeline/src/indesign/generate/; docs indocs/pipeline/indesign-output-generator.md.flavian-map-tokensbin alongside the new one.ajv/ajv-formats(pipeline devDeps) were materialized viapnpm install(lockfile unchanged) so the mapper's schema-validation tests run.🤖 Generated with Claude Code