@litfamily/litcodex 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README-Ko-KR.md +10 -10
  2. package/README.md +10 -10
  3. package/dist/install/generated-skill-payload-hashes.d.ts +101 -40
  4. package/dist/install/generated-skill-payload-hashes.js +101 -40
  5. package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
  6. package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
  7. package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
  8. package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
  9. package/marketplace/plugins/litcodex/components/lit-loop/dist/auto-handoff.js +11 -7
  10. package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
  11. package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
  12. package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
  13. package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
  14. package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
  15. package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
  16. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/THIRD-PARTY-NOTICE.txt +0 -2
  17. package/marketplace/plugins/litcodex/skills/lit-docx/SKILL.md +16 -12
  18. package/marketplace/plugins/litcodex/skills/lit-docx/references/components.md +113 -0
  19. package/marketplace/plugins/litcodex/skills/lit-docx/references/direction-step.md +164 -0
  20. package/marketplace/plugins/litcodex/skills/lit-docx/references/examples/01-report-ko.md +95 -0
  21. package/marketplace/plugins/litcodex/skills/lit-docx/references/examples/02-brief-ko.md +45 -0
  22. package/marketplace/plugins/litcodex/skills/lit-docx/references/examples/03-manual-ko.md +105 -0
  23. package/marketplace/plugins/litcodex/skills/lit-docx/references/examples/04-proposal-ko.md +97 -0
  24. package/marketplace/plugins/litcodex/skills/lit-docx/references/examples/05-memo-en.md +34 -0
  25. package/marketplace/plugins/litcodex/skills/lit-docx/references/examples/06-journal-en.md +89 -0
  26. package/marketplace/plugins/litcodex/skills/lit-docx/references/examples/07-report-en.md +101 -0
  27. package/marketplace/plugins/litcodex/skills/lit-docx/references/examples/08-proposal-en.md +94 -0
  28. package/marketplace/plugins/litcodex/skills/lit-docx/references/examples/09-memo-ko.md +34 -0
  29. package/marketplace/plugins/litcodex/skills/lit-docx/references/page-composition.md +141 -0
  30. package/marketplace/plugins/litcodex/skills/lit-docx/references/tonalities/brief.md +70 -0
  31. package/marketplace/plugins/litcodex/skills/lit-docx/references/tonalities/journal.md +73 -0
  32. package/marketplace/plugins/litcodex/skills/lit-docx/references/tonalities/manual.md +70 -0
  33. package/marketplace/plugins/litcodex/skills/lit-docx/references/tonalities/memo.md +75 -0
  34. package/marketplace/plugins/litcodex/skills/lit-docx/references/tonalities/proposal.md +71 -0
  35. package/marketplace/plugins/litcodex/skills/lit-docx/references/tonalities/report.md +83 -0
  36. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/convert_md_to_docx.py +401 -58
  37. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/docx_craft.py +124 -1
  38. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/docx_design.py +2446 -0
  39. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/docx_layout.py +960 -0
  40. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/slop_lint.py +21 -6
  41. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/brief.yaml +28 -0
  42. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/journal.yaml +26 -0
  43. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/manual.yaml +26 -0
  44. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/memo.yaml +27 -0
  45. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/proposal.yaml +27 -0
  46. package/marketplace/plugins/litcodex/skills/lit-docx/templates/tonalities/report.yaml +27 -0
  47. package/marketplace/plugins/litcodex/skills/lit-pptx/SKILL.md +12 -11
  48. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/public/static/Pretendard-Bold.otf +0 -0
  49. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/public/static/Pretendard-Regular.otf +0 -0
  50. package/marketplace/plugins/litcodex/skills/lit-pptx/references/anti-slop-checklist.md +33 -29
  51. package/marketplace/plugins/litcodex/skills/lit-pptx/references/authoring-guide.md +11 -2
  52. package/marketplace/plugins/litcodex/skills/lit-pptx/references/density-and-fill.md +179 -0
  53. package/marketplace/plugins/litcodex/skills/lit-pptx/references/design-system-azure.md +1 -1
  54. package/marketplace/plugins/litcodex/skills/lit-pptx/references/direction-step.md +203 -0
  55. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/01-pitch-signal-ko.md +185 -0
  56. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/02-pitch-studio-en.md +162 -0
  57. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/03-business-review-ledger-ko.md +229 -0
  58. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/04-research-talk-paper-en.md +212 -0
  59. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/05-research-keynote-night-ko.md +191 -0
  60. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/06-lecture-chalk-ko.md +175 -0
  61. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/07-data-review-night-en.md +241 -0
  62. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/08-field-report-atlas-ko.md +168 -0
  63. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/09-briefing-gazette-ko.md +219 -0
  64. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/10-status-update-ledger-en.md +157 -0
  65. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/11-portfolio-studio-ko.md +183 -0
  66. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/12-tutorial-chalk-en.md +176 -0
  67. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/13-status-update-gazette-ko.md +157 -0
  68. package/marketplace/plugins/litcodex/skills/lit-pptx/references/interview-protocol.md +1 -1
  69. package/marketplace/plugins/litcodex/skills/lit-pptx/references/layout-families.md +210 -0
  70. package/marketplace/plugins/litcodex/skills/lit-pptx/references/title-treatments.md +146 -0
  71. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/atlas.md +113 -0
  72. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/chalk.md +115 -0
  73. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/gazette.md +118 -0
  74. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/ledger.md +129 -0
  75. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/night.md +126 -0
  76. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/paper.md +109 -0
  77. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/signal.md +121 -0
  78. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/studio.md +111 -0
  79. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/compile-deck.js +65 -17
  80. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/craft_extras.py +654 -11
  81. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/embed_fonts.py +1 -1
  82. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/inventory.py +32 -2
  83. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/directive-parser.js +2 -2
  84. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/grid-resolver.js +521 -0
  85. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/layout-resolver.js +401 -16
  86. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/markdown-loader.js +6 -4
  87. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/render-adapter-html.js +2 -2
  88. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/render-adapter-pptx.js +498 -145
  89. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/render-pack.js +3558 -0
  90. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/slide-ast.js +54 -6
  91. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/template-registry.js +335 -11
  92. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/office-run.mjs +2 -1
  93. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/qa_deck.py +99 -19
  94. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/validate_pptx.py +6 -1
  95. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/boilerplate_professional.css +6 -6
  96. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-A2Z/layout-mapping.yaml +1 -1
  97. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-A2Z/template.yaml +4 -1
  98. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-PRO/layout-mapping.yaml +1 -1
  99. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-PRO/template.yaml +4 -1
  100. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +105 -0
  101. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +110 -0
  102. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +105 -0
  103. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +106 -0
  104. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/night/pack.yaml +106 -0
  105. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/paper/pack.yaml +111 -0
  106. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/signal/pack.yaml +107 -0
  107. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/studio/pack.yaml +105 -0
  108. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +1 -1
  109. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/fonts.mjs +6 -6
  110. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/gate.mjs +1 -1
  111. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-qa.mjs +2 -2
  112. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/runtime.md +1 -1
  113. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/stage.md +1 -1
  114. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/style-bibles.md +2 -2
  115. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/treatment.md +1 -1
  116. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/type-and-timing.md +3 -3
  117. package/node_modules/@litcodex/lit-loop/dist/auto-handoff.js +11 -7
  118. package/node_modules/@litcodex/lit-loop/package.json +1 -1
  119. package/package.json +2 -2
  120. package/readme-assets/badge-version.svg +1 -1
  121. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/public/static/PretendardGOV-Bold.otf +0 -0
  122. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/public/static/PretendardGOV-Regular.otf +0 -0
@@ -0,0 +1,111 @@
1
+ # Studio
2
+
3
+ Studio is a magazine spread. The 12-column grid shows through as one or two column hairlines,
4
+ titles live in a side rail or open the page at display size, splits are asymmetric, and real
5
+ numbers are set large on a tinted panel. A dark ochre accent marks the one thing to look at, and
6
+ the field is near-black. It suits work that has a point of view: a portfolio, a product with a
7
+ story, a public lecture.
8
+
9
+ ## Reach for it
10
+
11
+ - Portfolios, case studies, design and architecture presentations, product stories, public
12
+ lectures, pitches for physical or visual products.
13
+ - Outlines that mix pictures, a few strong figures and short editorial text.
14
+ - Second candidate for pitches and image-led decks; third for public lectures.
15
+
16
+ ## Pass on it
17
+
18
+ - Dense data reviews: editorial white space starves tables, and Studio has no table family.
19
+ Ledger or Night.
20
+ - Korean desk-read briefings: Gazette.
21
+ - Decks with no real figures or images: large numerals and splits need something true to show.
22
+
23
+ ## Tokens
24
+
25
+ | Token | Value |
26
+ |---|---|
27
+ | ground / surface | #FFFFFF / #F2F2F0 |
28
+ | ink / ink-muted / line | #141414 / #525252 / #D2D2CE |
29
+ | accent / accent-deep / accent-tint | #8A5A00 / #4D3200 / #F5ECD9 |
30
+ | field / on-field | #141414 / #FFFFFF |
31
+ | positive / negative | #1E7A3F / #B3261E |
32
+ | series | #8A5A00, #141414, #525252, #3B5F7F |
33
+ | faces | Pretendard Bold (display, title, numerals), Pretendard Regular (body, labels); `faces: a2z` gives A2Z Black display and numerals, A2Z Medium titles |
34
+ | type voice | tracking −1 titles, −2 display; proportional figures |
35
+ | table | `open`: no header fill, one rule under the header, no banding, bold totals |
36
+ | chart | no gridlines, direct labels, accent on the highlighted bar, annotation on |
37
+ | image | bleed and crop allowed, no frame |
38
+ | decoration | column hairlines, numeral, rail fill, colour field, caption band |
39
+ | radius / edge | 0 / fill |
40
+
41
+ ## Dials and type
42
+
43
+ Density 10, variance 8 (four or five treatments, a family at most twice in a row). The fill order
44
+ starts with `change-family`: when a page is short, the fix is a different family, not larger type.
45
+
46
+ ## Titles by role
47
+
48
+ | Role | Default |
49
+ |---|---|
50
+ | content, data-takeaway, sequence, reference, definition | `side-rail` |
51
+ | data | `top-plain-large` |
52
+ | image | `side-rail`, the picture's takeaways in the rail (`overlay` for `image-full`) |
53
+ | statement | `statement` (between two hairlines) |
54
+
55
+ `text-two-column` takes only `top-plain-large`; `photo-grid`, `timeline` and `asymmetric-feature`
56
+ take `top-plain-large` or `bottom-anchor`.
57
+
58
+ ## Families and variants
59
+
60
+ - `image-full`, `image-split`, `photo-grid`, `asymmetric-feature`: the picture families.
61
+ - `big-number`, `kpi-row`: real figures with basis rows, never decorative numerals.
62
+ - `chart-insight`: one chart with its reading, no gridlines.
63
+ - `comparison`, `timeline`, `text-two-column`: the argument, the programme, the brief.
64
+ - `statement`: between two hairlines on the open page, for a pull quote or a display-led deck on request
65
+ (a light rail beside it stood empty).
66
+ - Covers `cover-split-image` (the deck's first picture), `cover-rail`, `cover-numeral`; sections
67
+ `section-numeral`, `section-rail`; closings `closing-contact-split`, `closing-summary-list`.
68
+
69
+ Display devices: statement `rules`, number panel `tint`, closing floor `band`. Studio names no cover
70
+ device, so a generic cover draws `cover-split-image` when the deck has a picture.
71
+
72
+ ## Do
73
+
74
+ - Let one element dominate each page: a picture, a figure panel or the title.
75
+ - Give every large figure a label and a basis; a numeral with nothing behind it is a defect.
76
+ - Alternate rail and open pages so the grid reads as a rhythm, not a template.
77
+ - Prefer `closing-summary-list` with the ask and next step when the closing needs many words.
78
+
79
+ ## Avoid
80
+
81
+ - Large numerals that are not real figures.
82
+ - Column hairlines running through text.
83
+ - Two side-rail slides with the same split in a row.
84
+ - Centred body text.
85
+
86
+ ## Worked slide
87
+
88
+ The brief of a portfolio set as two columns of grouped facts under an open title.
89
+
90
+ ```markdown
91
+ ---
92
+ layout: text-two-column
93
+
94
+ ## 의뢰 배경과 작업 범위
95
+
96
+ - **의뢰 배경**
97
+ (1) 사과·참기름·잡곡을 파는 농가 세 곳, 연 매출 합계 14억 원
98
+ (2) 온라인 판매가 늘었지만 상자와 병이 도매용 그대로라 선물로 고르기 어려웠다
99
+ - **작업 범위**
100
+ (1) 브랜드 이름 글자와 색 체계, 상자·병·봉투 패키지 11종
101
+ (2) 택배용 완충 구조 설계와 파손 시험
102
+ - **조건과 결과**
103
+ (1) 기존 포장 단가보다 개당 10% 넘게 오르지 않을 것
104
+ (2) 실제 단가는 평균 6% 올랐고, 반품률은 1.2%로 내려갔다
105
+ - 주: 농가별 판매 기록과 택배 반품 기록, 2025년 9월-2026년 8월 기준 (예시)
106
+ ---
107
+ ```
108
+
109
+ ## Examples
110
+
111
+ `02-pitch-studio-en.md`, `11-portfolio-studio-ko.md`
@@ -87,7 +87,7 @@ function compileDeck(source) {
87
87
  // export exists to prevent.
88
88
  const BUNDLED_FONTS = [
89
89
  { match: /Pretendard/i, dir: "pretendard-font/public/static",
90
- files: ["PretendardGOV-Regular.otf", "PretendardGOV-Bold.otf"] },
90
+ files: ["Pretendard-Regular.otf", "Pretendard-Bold.otf"] },
91
91
  { match: /에이투지체/, dir: "fonts/a2z-font",
92
92
  files: ["A2Z-Regular.otf", "A2Z-Bold.otf"] },
93
93
  ];
@@ -143,11 +143,23 @@ async function resolveAndRender(ast, templateName, outputs, options = {}) {
143
143
  throw new Error("layout-resolver module not available. Cannot resolve layouts.");
144
144
  }
145
145
 
146
- const templateObj = templateRegistry.loadTemplate(templateName);
146
+ // A tonality (flag or frontmatter) is a design direction read from a pack; without one the named
147
+ // template loads as a legacy pack and keeps its own look.
148
+ const meta = (ast.deck && ast.deck.metadata) || {};
149
+ const tonality = options.tonality || meta.tonality || null;
150
+ const templateObj = tonality
151
+ ? templateRegistry.loadTonality(tonality, { density: meta.density, variance: meta.variance, canvas: meta.canvas, faces: options.faces || meta.faces })
152
+ : templateRegistry.loadTemplate(templateName);
153
+ if (tonality) {
154
+ const d = templateObj.pack.dials;
155
+ console.log(`Tonality ${templateObj.pack.id} · density ${d.density} · variance ${d.variance} · ${d.canvas} ${templateObj.pack.grid.name} grid` +
156
+ (templateName && templateName !== tonality ? ` (template ${templateName} not used)` : ""));
157
+ }
158
+ const can = (capability) => templateRegistry.hasCapability(templateObj, capability);
147
159
 
148
- // Font override (azure-style templates): swap the whole font system regardless
149
- // of which template was chosen. Applied before accent (independent of colour).
150
- if (options.font && templateObj.template && templateObj.template.render_style === "azure") {
160
+ // Font override (templates with the font-swap capability): swap the whole font system
161
+ // regardless of which template was chosen. Applied before accent (independent of colour).
162
+ if (options.font && can("font-swap")) {
151
163
  const { applyFont, KEYS } = require("./lib/font-map");
152
164
  if (KEYS.includes(options.font)) {
153
165
  applyFont(templateObj, options.font);
@@ -158,10 +170,10 @@ async function resolveAndRender(ast, templateName, outputs, options = {}) {
158
170
  const resolved = layoutResolver.resolve(ast, templateObj);
159
171
  if (options.sourceDir) resolved.sourceDir = options.sourceDir;
160
172
 
161
- // Custom accent recolor (azure-style templates only): derive a WCAG-safe
173
+ // Custom accent recolor (templates with the recolor capability): derive a WCAG-safe
162
174
  // palette from the accent hex, override template tokens + hardcoded decoration
163
175
  // colors, and regenerate the gradient circle PNGs in the new hue.
164
- if (options.accent && templateObj.template && templateObj.template.render_style === "azure") {
176
+ if (options.accent && can("recolor")) {
165
177
  const { derivePalette, defaultToDerivedMap } = require("./lib/derive-palette");
166
178
  const { genGradientAssets } = require("./lib/gen-gradient-assets");
167
179
  const os = require("os");
@@ -199,11 +211,11 @@ async function resolveAndRender(ast, templateName, outputs, options = {}) {
199
211
  console.log(`Accent ${options.accent} → primary ${derived.primary} (white-contrast ${derived._ratios.whiteOnPrimary}:1)`);
200
212
  }
201
213
 
202
- // Blurred gradient-mesh background (azure-style): ambient wash on cover/closing/
214
+ // Blurred gradient-mesh background (mesh-background capability): ambient wash on cover/closing/
203
215
  // content (light) and a deep textured wash on section dividers (dark). Uses the
204
216
  // ACTIVE palette (so it respects --accent). The dark mesh sits ABOVE the base
205
217
  // section fill rect, so qa_deck still resolves the (dark) fill behind white text.
206
- if (options.bg === "mesh" && templateObj.template && templateObj.template.render_style === "azure") {
218
+ if (options.bg === "mesh" && can("mesh-background")) {
207
219
  const { genMeshBg } = require("./lib/gen-bg");
208
220
  const os = require("os");
209
221
  const dims = templateObj.template.dimensions || {};
@@ -277,8 +289,36 @@ if (require.main === module) {
277
289
  }
278
290
  process.exit(0);
279
291
  }
292
+ if (args[0] === "--list-tonalities") {
293
+ const reg = require("./lib/template-registry");
294
+ for (const id of reg.listTonalities()) {
295
+ const p = reg.loadPack(id);
296
+ console.log(`${id} — ${p.intent} [density ${p.density}, variance ${p.variance}; ${p.treatments.join(", ")}]`);
297
+ }
298
+ for (const name of reg.listTemplates()) console.log(`${name} (legacy template)`);
299
+ process.exit(0);
300
+ }
280
301
  if (args[0] === "--list-layouts" && args[1]) {
281
302
  const reg = require("./lib/template-registry");
303
+ if (reg.listTonalities().includes(String(args[1]).toLowerCase())) {
304
+ // A tonality lists its families with the titles each can take there, and its variants.
305
+ const G = require("./lib/grid-resolver");
306
+ const p = reg.loadPack(args[1]);
307
+ console.log(`${p.id} — ${p.intent}`);
308
+ console.log(`treatments: ${p.treatments.join(", ")}`);
309
+ console.log("layout families:");
310
+ for (const f of p["layout-families"]) {
311
+ console.log(` ${f} [${G.familyAllows(f).filter((t) => p.treatments.includes(t)).join(", ")}]`);
312
+ }
313
+ console.log(`covers: ${p.covers.join(", ")}`);
314
+ console.log(`sections: ${p.sections.join(", ")}`);
315
+ console.log(`closings: ${p.closings.join(", ")}`);
316
+ process.exit(0);
317
+ }
318
+ if (!reg.listTemplates().includes(args[1])) {
319
+ console.error(`Unknown tonality or template "${args[1]}". Tonalities: ${reg.listTonalities().join(", ")}; legacy templates: ${reg.listTemplates().join(", ")}`);
320
+ process.exit(1);
321
+ }
282
322
  const t = reg.loadTemplate(args[1]);
283
323
  const layouts = (t.mapping && t.mapping.layouts) || {};
284
324
  const caps = (t.capabilities && t.capabilities.supported_blocks) || {};
@@ -294,10 +334,13 @@ if (require.main === module) {
294
334
  if (args.length === 0) {
295
335
  console.error("Usage:");
296
336
  console.error(" node compile-deck.js --list-templates");
297
- console.error(" node compile-deck.js --list-layouts <template>");
337
+ console.error(" node compile-deck.js --list-tonalities");
338
+ console.error(" node compile-deck.js --list-layouts <template or tonality>");
298
339
  console.error(" node compile-deck.js <input.md> [--ast out.json]");
299
340
  console.error(" node compile-deck.js <input.md> --template <name> --html out.html");
300
341
  console.error(" node compile-deck.js <input.md> --template <name> --pptx out.pptx");
342
+ console.error(" node compile-deck.js <input.md> --tonality <id> --pptx out.pptx (or tonality: in the frontmatter)");
343
+ console.error(" node compile-deck.js <input.md> --tonality <id> --faces a2z --pptx out.pptx (A2Z faces on request; Pretendard by default)");
301
344
  console.error(" node compile-deck.js <input.md> --template <name> --ast out.json --html out.html --pptx out.pptx");
302
345
  console.error(" node compile-deck.js <input.md> --template <name> --export-viz-context ctx.json");
303
346
  process.exit(1);
@@ -309,10 +352,12 @@ if (require.main === module) {
309
352
  let htmlPath = null;
310
353
  let pptxPath = null;
311
354
  let embedFonts = false;
355
+ let facesFlag = null;
312
356
  let accent = null;
313
357
  let font = null;
314
358
  let bg = null;
315
359
  let vizContextPath = null;
360
+ let tonalityFlag = null;
316
361
 
317
362
  for (let i = 1; i < args.length; i++) {
318
363
  if (args[i] === "--embed-fonts") { embedFonts = true; continue; }
@@ -320,6 +365,8 @@ if (require.main === module) {
320
365
  if (args[i] === "--font" && args[i + 1]) { font = args[i + 1]; i++; continue; }
321
366
  if (args[i] === "--bg" && args[i + 1]) { bg = args[i + 1]; i++; continue; }
322
367
  if (args[i] === "--export-viz-context" && args[i + 1]) { vizContextPath = args[i + 1]; i++; continue; }
368
+ if (args[i] === "--tonality" && args[i + 1]) { tonalityFlag = args[i + 1]; i++; continue; }
369
+ if (args[i] === "--faces" && args[i + 1]) { facesFlag = args[i + 1]; i++; continue; }
323
370
  if (args[i] === "--ast" && args[i + 1]) {
324
371
  astPath = args[i + 1];
325
372
  i++;
@@ -335,13 +382,14 @@ if (require.main === module) {
335
382
  }
336
383
  }
337
384
 
338
- // If --html or --pptx is requested, --template is required
339
- if ((htmlPath || pptxPath || vizContextPath) && !templateName) {
340
- console.error("Error: --template is required when using --html, --pptx or --export-viz-context");
385
+ const source = fs.readFileSync(inputPath, "utf-8");
386
+
387
+ // A render needs a design: --template, --tonality, or a tonality: line in the frontmatter.
388
+ const frontTonality = (source.match(/^---[ \t]*\n([\s\S]*?)\n---/) || ["", ""])[1].match(/^tonality:[ \t]*(\S+)/m);
389
+ if ((htmlPath || pptxPath || vizContextPath) && !templateName && !tonalityFlag && !frontTonality) {
390
+ console.error("Error: --template or --tonality (or tonality: in the frontmatter) is required when using --html, --pptx or --export-viz-context");
341
391
  process.exit(1);
342
392
  }
343
-
344
- const source = fs.readFileSync(inputPath, "utf-8");
345
393
  const sourceDir = path.dirname(path.resolve(inputPath));
346
394
 
347
395
  (async () => {
@@ -370,12 +418,12 @@ if (require.main === module) {
370
418
  }
371
419
 
372
420
  // Resolve and render if template + output formats specified
373
- if (templateName && (htmlPath || pptxPath || vizContextPath)) {
421
+ if (htmlPath || pptxPath || vizContextPath) {
374
422
  await resolveAndRender(ast, templateName, {
375
423
  html: htmlPath,
376
424
  pptx: pptxPath,
377
425
  vizContext: vizContextPath,
378
- }, { sourceDir, accent: effectiveAccent, font: effectiveFont, bg: effectiveBg });
426
+ }, { sourceDir, accent: effectiveAccent, font: effectiveFont, bg: effectiveBg, tonality: tonalityFlag, faces: facesFlag });
379
427
 
380
428
  // Optional: embed bundled fonts into the PPTX for a self-contained deck.
381
429
  if (embedFonts && pptxPath) {