@heylemon/lemonade 0.1.4 → 0.1.6
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.
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/web/inbound/monitor.js +0 -1
- package/package.json +1 -1
- package/skills/docx/SKILL.md +20 -464
- package/skills/docx/references/templates.md +46 -0
- package/skills/docx/scripts/create_doc.py +252 -0
- package/skills/docx/scripts/validate_doc.py +75 -0
- package/skills/pptx/SKILL.md +7 -215
- package/skills/pptx/references/spec-format.md +54 -0
- package/skills/pptx/scripts/create_pptx.js +218 -0
- package/skills/xlsx/SKILL.md +12 -281
- package/skills/xlsx/references/spec-format.md +53 -0
- package/skills/xlsx/scripts/create_xlsx.py +222 -0
- package/skills/xlsx/scripts/validate_xlsx.py +73 -0
- package/skills/pptx/editing.md +0 -205
- package/skills/pptx/pptxgenjs.md +0 -420
- package/skills/pptx/scripts/add_slide.py +0 -195
- package/skills/pptx/scripts/clean.py +0 -286
- package/skills/pptx/scripts/thumbnail.py +0 -289
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Pro Docs — Document Creation Engine
|
|
4
|
+
Takes a JSON document spec and produces a professionally formatted .docx file.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
import sys
|
|
9
|
+
from datetime import datetime
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from docx import Document
|
|
13
|
+
from docx.shared import Inches, Pt, RGBColor
|
|
14
|
+
from docx.enum.text import WD_ALIGN_PARAGRAPH
|
|
15
|
+
from docx.enum.table import WD_TABLE_ALIGNMENT
|
|
16
|
+
from docx.oxml.ns import nsdecls
|
|
17
|
+
from docx.oxml import parse_xml
|
|
18
|
+
except ImportError:
|
|
19
|
+
print("ERROR: python-docx not installed. Run: pip install python-docx --break-system-packages")
|
|
20
|
+
sys.exit(1)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
DEFAULT_BRAND = {
|
|
24
|
+
"primary_color": "1B3A5C",
|
|
25
|
+
"accent_color": "2E86AB",
|
|
26
|
+
"light_accent": "E8F4F8",
|
|
27
|
+
"text_color": "2C3E50",
|
|
28
|
+
"muted_color": "7F8C8D",
|
|
29
|
+
"font_heading": "Arial",
|
|
30
|
+
"font_body": "Arial",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
SIZES = {
|
|
34
|
+
"title": Pt(26),
|
|
35
|
+
"subtitle": Pt(14),
|
|
36
|
+
"h1": Pt(18),
|
|
37
|
+
"h2": Pt(14),
|
|
38
|
+
"h3": Pt(12),
|
|
39
|
+
"body": Pt(11),
|
|
40
|
+
"small": Pt(9),
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def hex_to_rgb(hex_color: str) -> RGBColor:
|
|
45
|
+
h = hex_color.lstrip("#")
|
|
46
|
+
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def set_cell_shading(cell, color_hex: str) -> None:
|
|
50
|
+
shading = parse_xml(f'<w:shd {nsdecls("w")} w:fill="{color_hex}" w:val="clear"/>')
|
|
51
|
+
cell._tc.get_or_add_tcPr().append(shading)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def set_cell_border(cell, color="D5D8DC") -> None:
|
|
55
|
+
tc = cell._tc
|
|
56
|
+
tc_pr = tc.get_or_add_tcPr()
|
|
57
|
+
borders = parse_xml(
|
|
58
|
+
f'<w:tcBorders {nsdecls("w")}>'
|
|
59
|
+
f' <w:top w:val="single" w:sz="4" w:space="0" w:color="{color}"/>'
|
|
60
|
+
f' <w:left w:val="single" w:sz="4" w:space="0" w:color="{color}"/>'
|
|
61
|
+
f' <w:bottom w:val="single" w:sz="4" w:space="0" w:color="{color}"/>'
|
|
62
|
+
f' <w:right w:val="single" w:sz="4" w:space="0" w:color="{color}"/>'
|
|
63
|
+
f"</w:tcBorders>"
|
|
64
|
+
)
|
|
65
|
+
tc_pr.append(borders)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class ProDocBuilder:
|
|
69
|
+
def __init__(self, spec):
|
|
70
|
+
self.spec = spec
|
|
71
|
+
self.brand = {**DEFAULT_BRAND, **spec.get("brand", {})}
|
|
72
|
+
self.doc = Document()
|
|
73
|
+
self._setup_styles()
|
|
74
|
+
self._setup_page()
|
|
75
|
+
|
|
76
|
+
def _setup_page(self):
|
|
77
|
+
section = self.doc.sections[0]
|
|
78
|
+
section.page_width = Inches(8.5)
|
|
79
|
+
section.page_height = Inches(11)
|
|
80
|
+
section.top_margin = Inches(0.8)
|
|
81
|
+
section.bottom_margin = Inches(0.8)
|
|
82
|
+
section.left_margin = Inches(1)
|
|
83
|
+
section.right_margin = Inches(1)
|
|
84
|
+
|
|
85
|
+
if self.spec.get("include_page_numbers", True):
|
|
86
|
+
footer = section.footer
|
|
87
|
+
fp = footer.paragraphs[0]
|
|
88
|
+
fp.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
89
|
+
run = fp.add_run()
|
|
90
|
+
run.font.size = SIZES["small"]
|
|
91
|
+
run.font.color.rgb = hex_to_rgb(self.brand["muted_color"])
|
|
92
|
+
fld_char1 = parse_xml(f'<w:fldChar {nsdecls("w")} w:fldCharType="begin"/>')
|
|
93
|
+
run._r.append(fld_char1)
|
|
94
|
+
instr = parse_xml(
|
|
95
|
+
f'<w:instrText {nsdecls("w")} xml:space="preserve"> PAGE </w:instrText>'
|
|
96
|
+
)
|
|
97
|
+
run._r.append(instr)
|
|
98
|
+
fld_char2 = parse_xml(f'<w:fldChar {nsdecls("w")} w:fldCharType="end"/>')
|
|
99
|
+
run._r.append(fld_char2)
|
|
100
|
+
|
|
101
|
+
def _setup_styles(self):
|
|
102
|
+
style = self.doc.styles["Normal"]
|
|
103
|
+
style.font.name = self.brand["font_body"]
|
|
104
|
+
style.font.size = SIZES["body"]
|
|
105
|
+
style.font.color.rgb = hex_to_rgb(self.brand["text_color"])
|
|
106
|
+
|
|
107
|
+
def _add_title_block(self):
|
|
108
|
+
title = self.spec.get("title", "Untitled Document")
|
|
109
|
+
subtitle = self.spec.get("subtitle", "")
|
|
110
|
+
author = self.spec.get("author", "")
|
|
111
|
+
date_str = self.spec.get("date", "auto")
|
|
112
|
+
if date_str == "auto":
|
|
113
|
+
date_str = datetime.now().strftime("%B %d, %Y")
|
|
114
|
+
|
|
115
|
+
p = self.doc.add_paragraph()
|
|
116
|
+
p.alignment = WD_ALIGN_PARAGRAPH.LEFT
|
|
117
|
+
run = p.add_run(title)
|
|
118
|
+
run.font.size = SIZES["title"]
|
|
119
|
+
run.font.bold = True
|
|
120
|
+
run.font.color.rgb = hex_to_rgb(self.brand["primary_color"])
|
|
121
|
+
run.font.name = self.brand["font_heading"]
|
|
122
|
+
|
|
123
|
+
if subtitle:
|
|
124
|
+
p2 = self.doc.add_paragraph()
|
|
125
|
+
r2 = p2.add_run(subtitle)
|
|
126
|
+
r2.font.size = SIZES["subtitle"]
|
|
127
|
+
r2.font.color.rgb = hex_to_rgb(self.brand["muted_color"])
|
|
128
|
+
r2.font.name = self.brand["font_heading"]
|
|
129
|
+
|
|
130
|
+
if author or date_str:
|
|
131
|
+
p3 = self.doc.add_paragraph()
|
|
132
|
+
r3 = p3.add_run(" · ".join([x for x in [author, date_str] if x]))
|
|
133
|
+
r3.font.size = SIZES["small"]
|
|
134
|
+
r3.font.color.rgb = hex_to_rgb(self.brand["muted_color"])
|
|
135
|
+
|
|
136
|
+
def _add_heading(self, text, level=1):
|
|
137
|
+
heading = self.doc.add_heading(text, level=level)
|
|
138
|
+
for run in heading.runs:
|
|
139
|
+
run.font.color.rgb = hex_to_rgb(self.brand["primary_color"])
|
|
140
|
+
run.font.name = self.brand["font_heading"]
|
|
141
|
+
return heading
|
|
142
|
+
|
|
143
|
+
def _add_paragraph(self, text):
|
|
144
|
+
p = self.doc.add_paragraph(text)
|
|
145
|
+
for run in p.runs:
|
|
146
|
+
run.font.name = self.brand["font_body"]
|
|
147
|
+
run.font.size = SIZES["body"]
|
|
148
|
+
run.font.color.rgb = hex_to_rgb(self.brand["text_color"])
|
|
149
|
+
|
|
150
|
+
def _add_bullets(self, items, numbered=False):
|
|
151
|
+
style = "List Number" if numbered else "List Bullet"
|
|
152
|
+
for item in items:
|
|
153
|
+
p = self.doc.add_paragraph(item, style=style)
|
|
154
|
+
for run in p.runs:
|
|
155
|
+
run.font.name = self.brand["font_body"]
|
|
156
|
+
run.font.size = SIZES["body"]
|
|
157
|
+
|
|
158
|
+
def _add_table(self, table_spec):
|
|
159
|
+
headers = table_spec.get("headers", [])
|
|
160
|
+
rows = table_spec.get("rows", [])
|
|
161
|
+
if not headers and not rows:
|
|
162
|
+
return
|
|
163
|
+
num_cols = len(headers) if headers else len(rows[0])
|
|
164
|
+
table = self.doc.add_table(rows=0, cols=num_cols)
|
|
165
|
+
table.alignment = WD_TABLE_ALIGNMENT.CENTER
|
|
166
|
+
|
|
167
|
+
if headers:
|
|
168
|
+
row = table.add_row()
|
|
169
|
+
for i, h in enumerate(headers):
|
|
170
|
+
cell = row.cells[i]
|
|
171
|
+
cell.text = str(h)
|
|
172
|
+
for p in cell.paragraphs:
|
|
173
|
+
for run in p.runs:
|
|
174
|
+
run.font.bold = True
|
|
175
|
+
run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF)
|
|
176
|
+
run.font.name = self.brand["font_heading"]
|
|
177
|
+
set_cell_shading(cell, self.brand["primary_color"])
|
|
178
|
+
set_cell_border(cell, self.brand["primary_color"])
|
|
179
|
+
|
|
180
|
+
for ri, row_data in enumerate(rows):
|
|
181
|
+
row = table.add_row()
|
|
182
|
+
for ci, cell_text in enumerate(row_data):
|
|
183
|
+
cell = row.cells[ci]
|
|
184
|
+
cell.text = str(cell_text)
|
|
185
|
+
if ri % 2 == 0:
|
|
186
|
+
set_cell_shading(cell, self.brand.get("light_accent", "F8F9FA"))
|
|
187
|
+
set_cell_border(cell, "D5D8DC")
|
|
188
|
+
|
|
189
|
+
def _add_callout(self, text):
|
|
190
|
+
p = self.doc.add_paragraph()
|
|
191
|
+
p_pr = p._p.get_or_add_pPr()
|
|
192
|
+
p_bdr = parse_xml(
|
|
193
|
+
f'<w:pBdr {nsdecls("w")}>'
|
|
194
|
+
f' <w:left w:val="single" w:sz="24" w:space="8" w:color="{self.brand["accent_color"]}"/>'
|
|
195
|
+
f"</w:pBdr>"
|
|
196
|
+
)
|
|
197
|
+
p_pr.append(p_bdr)
|
|
198
|
+
run = p.add_run(text)
|
|
199
|
+
run.font.size = SIZES["body"]
|
|
200
|
+
run.font.name = self.brand["font_body"]
|
|
201
|
+
run.font.color.rgb = hex_to_rgb(self.brand["text_color"])
|
|
202
|
+
|
|
203
|
+
def _process_section(self, section):
|
|
204
|
+
if section.get("page_break_before", False):
|
|
205
|
+
self.doc.add_page_break()
|
|
206
|
+
|
|
207
|
+
heading = section.get("heading", "")
|
|
208
|
+
if heading:
|
|
209
|
+
self._add_heading(heading, section.get("level", 1))
|
|
210
|
+
|
|
211
|
+
content = section.get("content", "")
|
|
212
|
+
if isinstance(content, list):
|
|
213
|
+
for para in content:
|
|
214
|
+
self._add_paragraph(para)
|
|
215
|
+
elif content:
|
|
216
|
+
for para in content.split("\n\n"):
|
|
217
|
+
self._add_paragraph(para.strip())
|
|
218
|
+
|
|
219
|
+
items = section.get("items", [])
|
|
220
|
+
if items:
|
|
221
|
+
self._add_bullets(items, section.get("numbered", False))
|
|
222
|
+
|
|
223
|
+
table_spec = section.get("table")
|
|
224
|
+
if table_spec:
|
|
225
|
+
self._add_table(table_spec)
|
|
226
|
+
|
|
227
|
+
callout = section.get("callout", "")
|
|
228
|
+
if callout:
|
|
229
|
+
self._add_callout(callout)
|
|
230
|
+
|
|
231
|
+
def build(self, output_path):
|
|
232
|
+
self._add_title_block()
|
|
233
|
+
for section in self.spec.get("sections", []):
|
|
234
|
+
self._process_section(section)
|
|
235
|
+
self.doc.save(output_path)
|
|
236
|
+
return output_path
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def main():
|
|
240
|
+
if len(sys.argv) < 3:
|
|
241
|
+
print("Usage: python create_doc.py spec.json output.docx")
|
|
242
|
+
sys.exit(1)
|
|
243
|
+
|
|
244
|
+
with open(sys.argv[1], "r", encoding="utf-8") as f:
|
|
245
|
+
spec = json.load(f)
|
|
246
|
+
builder = ProDocBuilder(spec)
|
|
247
|
+
builder.build(sys.argv[2])
|
|
248
|
+
print(f"Document created: {sys.argv[2]}")
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
if __name__ == "__main__":
|
|
252
|
+
main()
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Validate a .docx file for common formatting issues.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
from docx import Document
|
|
11
|
+
from docx.shared import Inches
|
|
12
|
+
except ImportError:
|
|
13
|
+
print("ERROR: python-docx not installed. Run: pip install python-docx --break-system-packages")
|
|
14
|
+
sys.exit(1)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def validate(path):
|
|
18
|
+
issues = []
|
|
19
|
+
warnings = []
|
|
20
|
+
|
|
21
|
+
if not os.path.exists(path):
|
|
22
|
+
print(f"ERROR: File not found: {path}")
|
|
23
|
+
return 1
|
|
24
|
+
|
|
25
|
+
doc = Document(path)
|
|
26
|
+
|
|
27
|
+
section = doc.sections[0]
|
|
28
|
+
if section.left_margin and section.left_margin < Inches(0.5):
|
|
29
|
+
warnings.append("Left margin is very small (< 0.5 inches)")
|
|
30
|
+
if section.right_margin and section.right_margin < Inches(0.5):
|
|
31
|
+
warnings.append("Right margin is very small (< 0.5 inches)")
|
|
32
|
+
|
|
33
|
+
heading_count = 0
|
|
34
|
+
fonts_used = set()
|
|
35
|
+
|
|
36
|
+
for p in doc.paragraphs:
|
|
37
|
+
if p.style.name.startswith("Heading"):
|
|
38
|
+
heading_count += 1
|
|
39
|
+
if p.text.strip().endswith("."):
|
|
40
|
+
warnings.append(f'Heading ends with period: "{p.text.strip()[:50]}"')
|
|
41
|
+
|
|
42
|
+
if p.text.strip().startswith(("•", "◦", "▪", "●", "○", "■", "–", "—")):
|
|
43
|
+
if not p.style.name.startswith("List"):
|
|
44
|
+
issues.append(f'Manual bullet character detected: "{p.text.strip()[:50]}"')
|
|
45
|
+
|
|
46
|
+
for run in p.runs:
|
|
47
|
+
if run.font.name:
|
|
48
|
+
fonts_used.add(run.font.name)
|
|
49
|
+
|
|
50
|
+
if len(fonts_used) > 3:
|
|
51
|
+
warnings.append(f"Too many fonts used ({len(fonts_used)}): {', '.join(sorted(fonts_used))}")
|
|
52
|
+
if heading_count == 0 and len(doc.paragraphs) > 10:
|
|
53
|
+
warnings.append("No headings found in a long document")
|
|
54
|
+
|
|
55
|
+
if issues:
|
|
56
|
+
print("Validation failed:")
|
|
57
|
+
for issue in issues:
|
|
58
|
+
print(f"- {issue}")
|
|
59
|
+
return 1
|
|
60
|
+
|
|
61
|
+
if warnings:
|
|
62
|
+
print("Validation warnings:")
|
|
63
|
+
for warning in warnings:
|
|
64
|
+
print(f"- {warning}")
|
|
65
|
+
return 0
|
|
66
|
+
|
|
67
|
+
print("Validation passed: no issues found")
|
|
68
|
+
return 0
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
if __name__ == "__main__":
|
|
72
|
+
if len(sys.argv) < 2:
|
|
73
|
+
print("Usage: python validate_doc.py document.docx")
|
|
74
|
+
sys.exit(1)
|
|
75
|
+
sys.exit(validate(sys.argv[1]))
|
package/skills/pptx/SKILL.md
CHANGED
|
@@ -1,232 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pptx
|
|
3
|
-
description: "
|
|
3
|
+
description: "Create professional, polished slide decks using a deterministic PptxGenJS script. Trigger for presentation, slides, deck, and .pptx requests."
|
|
4
4
|
license: Proprietary. LICENSE.txt has complete terms
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# PPTX
|
|
7
|
+
# Pro Slides for PPTX
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
| Task | Guide |
|
|
12
|
-
|------|-------|
|
|
13
|
-
| Read/analyze content | `python -m markitdown presentation.pptx` |
|
|
14
|
-
| Edit or create from template | Read [editing.md](editing.md) |
|
|
15
|
-
| Create from scratch | Read [pptxgenjs.md](pptxgenjs.md) |
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Reading Content
|
|
9
|
+
Use the scripted path:
|
|
20
10
|
|
|
21
11
|
```bash
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# Visual overview
|
|
26
|
-
python scripts/thumbnail.py presentation.pptx
|
|
27
|
-
|
|
28
|
-
# Raw XML
|
|
29
|
-
python scripts/office/unpack.py presentation.pptx unpacked/
|
|
12
|
+
npm install -g pptxgenjs 2>/dev/null
|
|
13
|
+
node scripts/create_pptx.js spec.json output.pptx
|
|
30
14
|
```
|
|
31
15
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Editing Workflow
|
|
35
|
-
|
|
36
|
-
**Read [editing.md](editing.md) for full details.**
|
|
37
|
-
|
|
38
|
-
1. Analyze template with `thumbnail.py`
|
|
39
|
-
2. Unpack → manipulate slides → edit content → clean → pack
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Creating from Scratch
|
|
44
|
-
|
|
45
|
-
**Read [pptxgenjs.md](pptxgenjs.md) for full details.**
|
|
46
|
-
|
|
47
|
-
Use when no template or reference presentation is available.
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## Design Ideas
|
|
52
|
-
|
|
53
|
-
**Don't create boring slides.** Plain bullets on a white background won't impress anyone. Consider ideas from this list for each slide.
|
|
54
|
-
|
|
55
|
-
### Before Starting
|
|
56
|
-
|
|
57
|
-
- **Pick a bold, content-informed color palette**: The palette should feel designed for THIS topic. If swapping your colors into a completely different presentation would still "work," you haven't made specific enough choices.
|
|
58
|
-
- **Dominance over equality**: One color should dominate (60-70% visual weight), with 1-2 supporting tones and one sharp accent. Never give all colors equal weight.
|
|
59
|
-
- **Dark/light contrast**: Dark backgrounds for title + conclusion slides, light for content ("sandwich" structure). Or commit to dark throughout for a premium feel.
|
|
60
|
-
- **Commit to a visual motif**: Pick ONE distinctive element and repeat it — rounded image frames, icons in colored circles, thick single-side borders. Carry it across every slide.
|
|
61
|
-
|
|
62
|
-
### Color Palettes
|
|
63
|
-
|
|
64
|
-
Choose colors that match your topic — don't default to generic blue. Use these palettes as inspiration:
|
|
65
|
-
|
|
66
|
-
| Theme | Primary | Secondary | Accent |
|
|
67
|
-
|-------|---------|-----------|--------|
|
|
68
|
-
| **Midnight Executive** | `1E2761` (navy) | `CADCFC` (ice blue) | `FFFFFF` (white) |
|
|
69
|
-
| **Forest & Moss** | `2C5F2D` (forest) | `97BC62` (moss) | `F5F5F5` (cream) |
|
|
70
|
-
| **Coral Energy** | `F96167` (coral) | `F9E795` (gold) | `2F3C7E` (navy) |
|
|
71
|
-
| **Warm Terracotta** | `B85042` (terracotta) | `E7E8D1` (sand) | `A7BEAE` (sage) |
|
|
72
|
-
| **Ocean Gradient** | `065A82` (deep blue) | `1C7293` (teal) | `21295C` (midnight) |
|
|
73
|
-
| **Charcoal Minimal** | `36454F` (charcoal) | `F2F2F2` (off-white) | `212121` (black) |
|
|
74
|
-
| **Teal Trust** | `028090` (teal) | `00A896` (seafoam) | `02C39A` (mint) |
|
|
75
|
-
| **Berry & Cream** | `6D2E46` (berry) | `A26769` (dusty rose) | `ECE2D0` (cream) |
|
|
76
|
-
| **Sage Calm** | `84B59F` (sage) | `69A297` (eucalyptus) | `50808E` (slate) |
|
|
77
|
-
| **Cherry Bold** | `990011` (cherry) | `FCF6F5` (off-white) | `2F3C7E` (navy) |
|
|
78
|
-
|
|
79
|
-
### For Each Slide
|
|
80
|
-
|
|
81
|
-
**Every slide needs a visual element** — image, chart, icon, or shape. Text-only slides are forgettable.
|
|
82
|
-
|
|
83
|
-
**Layout options:**
|
|
84
|
-
- Two-column (text left, illustration on right)
|
|
85
|
-
- Icon + text rows (icon in colored circle, bold header, description below)
|
|
86
|
-
- 2x2 or 2x3 grid (image on one side, grid of content blocks on other)
|
|
87
|
-
- Half-bleed image (full left or right side) with content overlay
|
|
88
|
-
|
|
89
|
-
**Data display:**
|
|
90
|
-
- Large stat callouts (big numbers 60-72pt with small labels below)
|
|
91
|
-
- Comparison columns (before/after, pros/cons, side-by-side options)
|
|
92
|
-
- Timeline or process flow (numbered steps, arrows)
|
|
93
|
-
|
|
94
|
-
**Visual polish:**
|
|
95
|
-
- Icons in small colored circles next to section headers
|
|
96
|
-
- Italic accent text for key stats or taglines
|
|
97
|
-
|
|
98
|
-
### Typography
|
|
99
|
-
|
|
100
|
-
**Choose an interesting font pairing** — don't default to Arial. Pick a header font with personality and pair it with a clean body font.
|
|
101
|
-
|
|
102
|
-
| Header Font | Body Font |
|
|
103
|
-
|-------------|-----------|
|
|
104
|
-
| Georgia | Calibri |
|
|
105
|
-
| Arial Black | Arial |
|
|
106
|
-
| Calibri | Calibri Light |
|
|
107
|
-
| Cambria | Calibri |
|
|
108
|
-
| Trebuchet MS | Calibri |
|
|
109
|
-
| Impact | Arial |
|
|
110
|
-
| Palatino | Garamond |
|
|
111
|
-
| Consolas | Calibri |
|
|
112
|
-
|
|
113
|
-
| Element | Size |
|
|
114
|
-
|---------|------|
|
|
115
|
-
| Slide title | 36-44pt bold |
|
|
116
|
-
| Section header | 20-24pt bold |
|
|
117
|
-
| Body text | 14-16pt |
|
|
118
|
-
| Captions | 10-12pt muted |
|
|
119
|
-
|
|
120
|
-
### Spacing
|
|
121
|
-
|
|
122
|
-
- 0.5" minimum margins
|
|
123
|
-
- 0.3-0.5" between content blocks
|
|
124
|
-
- Leave breathing room—don't fill every inch
|
|
125
|
-
|
|
126
|
-
### Avoid (Common Mistakes)
|
|
127
|
-
|
|
128
|
-
- **Don't repeat the same layout** — vary columns, cards, and callouts across slides
|
|
129
|
-
- **Don't center body text** — left-align paragraphs and lists; center only titles
|
|
130
|
-
- **Don't skimp on size contrast** — titles need 36pt+ to stand out from 14-16pt body
|
|
131
|
-
- **Don't default to blue** — pick colors that reflect the specific topic
|
|
132
|
-
- **Don't mix spacing randomly** — choose 0.3" or 0.5" gaps and use consistently
|
|
133
|
-
- **Don't style one slide and leave the rest plain** — commit fully or keep it simple throughout
|
|
134
|
-
- **Don't create text-only slides** — add images, icons, charts, or visual elements; avoid plain title + bullets
|
|
135
|
-
- **Don't forget text box padding** — when aligning lines or shapes with text edges, set `margin: 0` on the text box or offset the shape to account for padding
|
|
136
|
-
- **Don't use low-contrast elements** — icons AND text need strong contrast against the background; avoid light text on light backgrounds or dark text on dark backgrounds
|
|
137
|
-
- **NEVER use accent lines under titles** — these are a hallmark of AI-generated slides; use whitespace or background color instead
|
|
138
|
-
|
|
139
|
-
---
|
|
16
|
+
Use `references/spec-format.md` for slide schema and themes.
|
|
140
17
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
**Assume there are problems. Your job is to find them.**
|
|
144
|
-
|
|
145
|
-
Your first render is almost never correct. Approach QA as a bug hunt, not a confirmation step. If you found zero issues on first inspection, you weren't looking hard enough.
|
|
146
|
-
|
|
147
|
-
### Content QA
|
|
18
|
+
Recommended QA:
|
|
148
19
|
|
|
149
20
|
```bash
|
|
150
21
|
python -m markitdown output.pptx
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Check for missing content, typos, wrong order.
|
|
154
|
-
|
|
155
|
-
**When using templates, check for leftover placeholder text:**
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
python -m markitdown output.pptx | grep -iE "xxxx|lorem|ipsum|this.*(page|slide).*layout"
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
If grep returns results, fix them before declaring success.
|
|
162
|
-
|
|
163
|
-
### Visual QA
|
|
164
|
-
|
|
165
|
-
**⚠️ USE SUBAGENTS** — even for 2-3 slides. You've been staring at the code and will see what you expect, not what's there. Subagents have fresh eyes.
|
|
166
|
-
|
|
167
|
-
Convert slides to images (see [Converting to Images](#converting-to-images)), then use this prompt:
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
Visually inspect these slides. Assume there are issues — find them.
|
|
171
|
-
|
|
172
|
-
Look for:
|
|
173
|
-
- Overlapping elements (text through shapes, lines through words, stacked elements)
|
|
174
|
-
- Text overflow or cut off at edges/box boundaries
|
|
175
|
-
- Decorative lines positioned for single-line text but title wrapped to two lines
|
|
176
|
-
- Source citations or footers colliding with content above
|
|
177
|
-
- Elements too close (< 0.3" gaps) or cards/sections nearly touching
|
|
178
|
-
- Uneven gaps (large empty area in one place, cramped in another)
|
|
179
|
-
- Insufficient margin from slide edges (< 0.5")
|
|
180
|
-
- Columns or similar elements not aligned consistently
|
|
181
|
-
- Low-contrast text (e.g., light gray text on cream-colored background)
|
|
182
|
-
- Low-contrast icons (e.g., dark icons on dark backgrounds without a contrasting circle)
|
|
183
|
-
- Text boxes too narrow causing excessive wrapping
|
|
184
|
-
- Leftover placeholder content
|
|
185
|
-
|
|
186
|
-
For each slide, list issues or areas of concern, even if minor.
|
|
187
|
-
|
|
188
|
-
Read and analyze these images:
|
|
189
|
-
1. /path/to/slide-01.jpg (Expected: [brief description])
|
|
190
|
-
2. /path/to/slide-02.jpg (Expected: [brief description])
|
|
191
|
-
|
|
192
|
-
Report ALL issues found, including minor ones.
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Verification Loop
|
|
196
|
-
|
|
197
|
-
1. Generate slides → Convert to images → Inspect
|
|
198
|
-
2. **List issues found** (if none found, look again more critically)
|
|
199
|
-
3. Fix issues
|
|
200
|
-
4. **Re-verify affected slides** — one fix often creates another problem
|
|
201
|
-
5. Repeat until a full pass reveals no new issues
|
|
202
|
-
|
|
203
|
-
**Do not declare success until you've completed at least one fix-and-verify cycle.**
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## Converting to Images
|
|
208
|
-
|
|
209
|
-
Convert presentations to individual slide images for visual inspection:
|
|
210
|
-
|
|
211
|
-
```bash
|
|
212
22
|
python scripts/office/soffice.py --headless --convert-to pdf output.pptx
|
|
213
23
|
pdftoppm -jpeg -r 150 output.pdf slide
|
|
214
24
|
```
|
|
215
|
-
|
|
216
|
-
This creates `slide-01.jpg`, `slide-02.jpg`, etc.
|
|
217
|
-
|
|
218
|
-
To re-render specific slides after fixes:
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
pdftoppm -jpeg -r 150 -f N -l N output.pdf slide-fixed
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
## Dependencies
|
|
227
|
-
|
|
228
|
-
- `pip install "markitdown[pptx]"` - text extraction
|
|
229
|
-
- `pip install Pillow` - thumbnail grids
|
|
230
|
-
- `npm install -g pptxgenjs` - creating from scratch
|
|
231
|
-
- LibreOffice (`soffice`) - PDF conversion (auto-configured for sandboxed environments via `scripts/office/soffice.py`)
|
|
232
|
-
- Poppler (`pdftoppm`) - PDF to images
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Slide Spec Format
|
|
2
|
+
|
|
3
|
+
## Top Level
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"title": "Presentation Title",
|
|
8
|
+
"author": "Author Name",
|
|
9
|
+
"theme": {},
|
|
10
|
+
"slides": []
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Theme
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
"theme": {
|
|
18
|
+
"primary": "1E2761",
|
|
19
|
+
"secondary": "CADCFC",
|
|
20
|
+
"accent": "F5A623",
|
|
21
|
+
"text_dark": "1E293B",
|
|
22
|
+
"text_light": "FFFFFF",
|
|
23
|
+
"text_muted": "64748B",
|
|
24
|
+
"bg_light": "F8FAFC",
|
|
25
|
+
"bg_dark": "1E2761",
|
|
26
|
+
"font_heading": "Arial Black",
|
|
27
|
+
"font_body": "Arial",
|
|
28
|
+
"chart_colors": ["2E86AB", "F5A623", "E74C3C", "2ECC71", "9B59B6"]
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Slide Types
|
|
33
|
+
|
|
34
|
+
- `title`
|
|
35
|
+
- `section`
|
|
36
|
+
- `content`
|
|
37
|
+
- `two_column`
|
|
38
|
+
- `stats`
|
|
39
|
+
- `comparison`
|
|
40
|
+
- `closing`
|
|
41
|
+
|
|
42
|
+
## Example
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"title": "Q1 Board Update",
|
|
47
|
+
"author": "Lemon",
|
|
48
|
+
"slides": [
|
|
49
|
+
{"type": "title", "title": "Q1 Board Update", "subtitle": "Performance & Plan"},
|
|
50
|
+
{"type": "stats", "title": "Key Metrics", "stats": [{"value": "$156K", "label": "Monthly Revenue"}]},
|
|
51
|
+
{"type": "content", "title": "Revenue Beat Target by 15%", "items": ["Growth driven by enterprise wins", "Pipeline conversion improved"]}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
```
|