@farazirfan/costar-server-executor 1.7.37 → 1.7.39
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/agent/agent.d.ts +90 -0
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.js +606 -0
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/pi-embedded-runner/run.d.ts.map +1 -1
- package/dist/agent/pi-embedded-runner/run.js +2 -1
- package/dist/agent/pi-embedded-runner/run.js.map +1 -1
- package/dist/agent/pi-embedded-runner/system-prompt.d.ts.map +1 -1
- package/dist/agent/pi-embedded-runner/system-prompt.js +16 -37
- package/dist/agent/pi-embedded-runner/system-prompt.js.map +1 -1
- package/dist/agent/pi-embedded-runner/tools.d.ts +4 -1
- package/dist/agent/pi-embedded-runner/tools.d.ts.map +1 -1
- package/dist/agent/pi-embedded-runner/tools.js +3 -1
- package/dist/agent/pi-embedded-runner/tools.js.map +1 -1
- package/dist/agent/pi-embedded-runner/types.d.ts +4 -0
- package/dist/agent/pi-embedded-runner/types.d.ts.map +1 -1
- package/dist/cli/env-loader.d.ts.map +1 -1
- package/dist/cli/env-loader.js +1 -0
- package/dist/cli/env-loader.js.map +1 -1
- package/dist/cli/setup.js +2 -2
- package/dist/cli/setup.js.map +1 -1
- package/dist/cron/normalize.d.ts +31 -0
- package/dist/cron/normalize.d.ts.map +1 -0
- package/dist/cron/normalize.js +211 -0
- package/dist/cron/normalize.js.map +1 -0
- package/dist/cron/scheduler.d.ts +33 -3
- package/dist/cron/scheduler.d.ts.map +1 -1
- package/dist/cron/scheduler.js +253 -48
- package/dist/cron/scheduler.js.map +1 -1
- package/dist/heartbeat/runner.d.ts +27 -12
- package/dist/heartbeat/runner.d.ts.map +1 -1
- package/dist/heartbeat/runner.js +82 -104
- package/dist/heartbeat/runner.js.map +1 -1
- package/dist/infra/heartbeat-events-filter.d.ts +29 -0
- package/dist/infra/heartbeat-events-filter.d.ts.map +1 -0
- package/dist/infra/heartbeat-events-filter.js +80 -0
- package/dist/infra/heartbeat-events-filter.js.map +1 -0
- package/dist/infra/index.d.ts +9 -0
- package/dist/infra/index.d.ts.map +1 -0
- package/dist/infra/index.js +9 -0
- package/dist/infra/index.js.map +1 -0
- package/dist/infra/system-events.d.ts +58 -2
- package/dist/infra/system-events.d.ts.map +1 -1
- package/dist/infra/system-events.js +80 -14
- package/dist/infra/system-events.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +6 -1
- package/dist/server.js.map +1 -1
- package/dist/services/platform-keys.d.ts +19 -0
- package/dist/services/platform-keys.d.ts.map +1 -0
- package/dist/services/platform-keys.js +74 -0
- package/dist/services/platform-keys.js.map +1 -0
- package/dist/subagent/registry.d.ts +96 -0
- package/dist/subagent/registry.d.ts.map +1 -0
- package/dist/subagent/registry.js +180 -0
- package/dist/subagent/registry.js.map +1 -0
- package/dist/tools/complete-turn.d.ts +2 -2
- package/dist/tools/complete-turn.js +10 -10
- package/dist/tools/complete-turn.js.map +1 -1
- package/dist/tools/contacts.d.ts +13 -0
- package/dist/tools/contacts.d.ts.map +1 -0
- package/dist/tools/contacts.js +80 -0
- package/dist/tools/contacts.js.map +1 -0
- package/dist/tools/cron.d.ts +17 -2
- package/dist/tools/cron.d.ts.map +1 -1
- package/dist/tools/cron.js +117 -35
- package/dist/tools/cron.js.map +1 -1
- package/dist/tools/google-maps.d.ts +6 -6
- package/dist/tools/google-maps.d.ts.map +1 -1
- package/dist/tools/google-maps.js +207 -262
- package/dist/tools/google-maps.js.map +1 -1
- package/dist/tools/index.d.ts +17 -7
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +40 -9
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/phone-call.d.ts +11 -0
- package/dist/tools/phone-call.d.ts.map +1 -0
- package/dist/tools/phone-call.js +151 -0
- package/dist/tools/phone-call.js.map +1 -0
- package/dist/tools/sessions-spawn.d.ts +33 -0
- package/dist/tools/sessions-spawn.d.ts.map +1 -0
- package/dist/tools/sessions-spawn.js +164 -0
- package/dist/tools/sessions-spawn.js.map +1 -0
- package/dist/tools/spotify.d.ts +12 -0
- package/dist/tools/spotify.d.ts.map +1 -0
- package/dist/tools/spotify.js +251 -0
- package/dist/tools/spotify.js.map +1 -0
- package/dist/tools/subagents.d.ts +23 -0
- package/dist/tools/subagents.d.ts.map +1 -0
- package/dist/tools/subagents.js +209 -0
- package/dist/tools/subagents.js.map +1 -0
- package/dist/tools/whatsapp.d.ts +13 -0
- package/dist/tools/whatsapp.d.ts.map +1 -0
- package/dist/tools/whatsapp.js +215 -0
- package/dist/tools/whatsapp.js.map +1 -0
- package/dist/tools/youtube.d.ts +12 -0
- package/dist/tools/youtube.d.ts.map +1 -0
- package/dist/tools/youtube.js +218 -0
- package/dist/tools/youtube.js.map +1 -0
- package/dist/utils/asterizk-auth.d.ts +43 -0
- package/dist/utils/asterizk-auth.d.ts.map +1 -0
- package/dist/utils/asterizk-auth.js +125 -0
- package/dist/utils/asterizk-auth.js.map +1 -0
- package/dist/web-server.d.ts.map +1 -1
- package/dist/web-server.js +132 -0
- package/dist/web-server.js.map +1 -1
- package/dist/workspace/index.d.ts +3 -4
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +3 -4
- package/dist/workspace/index.js.map +1 -1
- package/dist/workspace/templates.d.ts +8 -7
- package/dist/workspace/templates.d.ts.map +1 -1
- package/dist/workspace/templates.js +18 -127
- package/dist/workspace/templates.js.map +1 -1
- package/dist/workspace/workspace.d.ts +2 -4
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +7 -16
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +1 -1
- package/public/index.html +231 -0
- package/skills/docx/SKILL.md +468 -0
- package/skills/docx/scripts/__init__.py +1 -0
- package/skills/docx/scripts/accept_changes.py +181 -0
- package/skills/docx/scripts/comment.py +347 -0
- package/skills/docx/scripts/helpers/__init__.py +0 -0
- package/skills/docx/scripts/helpers/merge_runs.py +231 -0
- package/skills/docx/scripts/helpers/simplify_redlines.py +240 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/docx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/docx/scripts/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/docx/scripts/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/docx/scripts/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/docx/scripts/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/docx/scripts/ooxml/schemas/mce/mc.xsd +75 -0
- package/skills/docx/scripts/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/docx/scripts/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/docx/scripts/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/docx/scripts/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/docx/scripts/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/docx/scripts/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/docx/scripts/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/docx/scripts/ooxml/scripts/pack.py +159 -0
- package/skills/docx/scripts/ooxml/scripts/unpack.py +29 -0
- package/skills/docx/scripts/ooxml/scripts/validate.py +106 -0
- package/skills/docx/scripts/ooxml/scripts/validation/__init__.py +15 -0
- package/skills/docx/scripts/ooxml/scripts/validation/base.py +1023 -0
- package/skills/docx/scripts/ooxml/scripts/validation/docx.py +519 -0
- package/skills/docx/scripts/ooxml/scripts/validation/pptx.py +315 -0
- package/skills/docx/scripts/ooxml/scripts/validation/redlining.py +284 -0
- package/skills/docx/scripts/pack.py +166 -0
- package/skills/docx/scripts/templates/comments.xml +3 -0
- package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/skills/docx/scripts/templates/people.xml +3 -0
- package/skills/docx/scripts/unpack.py +134 -0
- package/skills/longform-video-generation/SKILL.md +298 -0
- package/skills/longform-video-generation/references/advanced_techniques.md +474 -0
- package/skills/longform-video-generation/references/google_api_guide.md +288 -0
- package/skills/longform-video-generation/scripts/video_generator.py +579 -0
- package/skills/pdf/FORMS.md +305 -0
- package/skills/pdf/REFERENCE.md +612 -0
- package/skills/pdf/SKILL.md +293 -0
- package/skills/pdf/scripts/check_bounding_boxes.py +70 -0
- package/skills/pdf/scripts/check_fillable_fields.py +12 -0
- package/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/skills/pdf/scripts/create_validation_image.py +41 -0
- package/skills/pdf/scripts/extract_form_field_info.py +152 -0
- package/skills/pdf/scripts/extract_form_structure.py +124 -0
- package/skills/pdf/scripts/fill_fillable_fields.py +116 -0
- package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +136 -0
- package/skills/pptx/SKILL.md +171 -0
- package/skills/pptx/editing.md +205 -0
- package/skills/pptx/pptxgenjs.md +377 -0
- package/skills/pptx/scripts/add_slide.py +225 -0
- package/skills/pptx/scripts/clean.py +309 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/pptx/scripts/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/pptx/scripts/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/pptx/scripts/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/pptx/scripts/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/pptx/scripts/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/pptx/scripts/ooxml/schemas/mce/mc.xsd +75 -0
- package/skills/pptx/scripts/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/pptx/scripts/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/pptx/scripts/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/pptx/scripts/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/pptx/scripts/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/pptx/scripts/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/pptx/scripts/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/pptx/scripts/ooxml/scripts/pack.py +159 -0
- package/skills/pptx/scripts/ooxml/scripts/unpack.py +29 -0
- package/skills/pptx/scripts/ooxml/scripts/validate.py +106 -0
- package/skills/pptx/scripts/ooxml/scripts/validation/__init__.py +15 -0
- package/skills/pptx/scripts/ooxml/scripts/validation/base.py +1023 -0
- package/skills/pptx/scripts/ooxml/scripts/validation/docx.py +519 -0
- package/skills/pptx/scripts/ooxml/scripts/validation/pptx.py +315 -0
- package/skills/pptx/scripts/ooxml/scripts/validation/redlining.py +284 -0
- package/skills/pptx/scripts/pack.py +168 -0
- package/skills/pptx/scripts/thumbnail.py +318 -0
- package/skills/pptx/scripts/unpack.py +86 -0
- package/skills/xlsx/SKILL.md +291 -0
- package/skills/xlsx/recalc.py +247 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Editing Presentations
|
|
2
|
+
|
|
3
|
+
## Template-Based Workflow
|
|
4
|
+
|
|
5
|
+
When using an existing presentation as a template:
|
|
6
|
+
|
|
7
|
+
1. **Analyze existing slides**:
|
|
8
|
+
```bash
|
|
9
|
+
python scripts/thumbnail.py template.pptx
|
|
10
|
+
python -m markitdown template.pptx
|
|
11
|
+
```
|
|
12
|
+
Review `thumbnails.jpg` to see layouts, and markitdown output to see placeholder text.
|
|
13
|
+
|
|
14
|
+
2. **Plan slide mapping**: For each content section, choose a template slide.
|
|
15
|
+
|
|
16
|
+
⚠️ **USE VARIED LAYOUTS** — monotonous presentations are a common failure mode. Don't default to basic title + bullet slides. Actively seek out:
|
|
17
|
+
- Multi-column layouts (2-column, 3-column)
|
|
18
|
+
- Image + text combinations
|
|
19
|
+
- Full-bleed images with text overlay
|
|
20
|
+
- Quote or callout slides
|
|
21
|
+
- Section dividers
|
|
22
|
+
- Stat/number callouts
|
|
23
|
+
- Icon grids or icon + text rows
|
|
24
|
+
|
|
25
|
+
**Avoid:** Repeating the same text-heavy layout for every slide.
|
|
26
|
+
|
|
27
|
+
Match content type to layout style (e.g., key points → bullet slide, team info → multi-column, testimonials → quote slide).
|
|
28
|
+
|
|
29
|
+
3. **Unpack**: `python scripts/unpack.py template.pptx unpacked/`
|
|
30
|
+
|
|
31
|
+
4. **Build presentation** (do this yourself, not with subagents):
|
|
32
|
+
- Delete unwanted slides (remove from `<p:sldIdLst>`)
|
|
33
|
+
- Duplicate slides you want to reuse (`add_slide.py`)
|
|
34
|
+
- Reorder slides in `<p:sldIdLst>`
|
|
35
|
+
- **Complete all structural changes before step 5**
|
|
36
|
+
|
|
37
|
+
5. **Edit content**: Update text in each `slide{N}.xml`.
|
|
38
|
+
**Use subagents here if available** — slides are separate XML files, so subagents can edit in parallel.
|
|
39
|
+
|
|
40
|
+
6. **Clean**: `python scripts/clean.py unpacked/`
|
|
41
|
+
|
|
42
|
+
7. **Pack**: `python scripts/pack.py unpacked/ output.pptx --original template.pptx`
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Scripts
|
|
47
|
+
|
|
48
|
+
| Script | Purpose |
|
|
49
|
+
|--------|---------|
|
|
50
|
+
| `unpack.py` | Extract and pretty-print PPTX |
|
|
51
|
+
| `add_slide.py` | Duplicate slide or create from layout |
|
|
52
|
+
| `clean.py` | Remove orphaned files |
|
|
53
|
+
| `pack.py` | Repack with validation |
|
|
54
|
+
| `thumbnail.py` | Create visual grid of slides |
|
|
55
|
+
|
|
56
|
+
### unpack.py
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
python scripts/unpack.py input.pptx unpacked/
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Extracts PPTX, pretty-prints XML, escapes smart quotes.
|
|
63
|
+
|
|
64
|
+
### add_slide.py
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
python scripts/add_slide.py unpacked/ slide2.xml # Duplicate slide
|
|
68
|
+
python scripts/add_slide.py unpacked/ slideLayout2.xml # From layout
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Prints `<p:sldId>` to add to `<p:sldIdLst>` at desired position.
|
|
72
|
+
|
|
73
|
+
### clean.py
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
python scripts/clean.py unpacked/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Removes slides not in `<p:sldIdLst>`, unreferenced media, orphaned rels.
|
|
80
|
+
|
|
81
|
+
### pack.py
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
python scripts/pack.py unpacked/ output.pptx --original input.pptx
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Validates, repairs, condenses XML, re-encodes smart quotes.
|
|
88
|
+
|
|
89
|
+
### thumbnail.py
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
python scripts/thumbnail.py input.pptx [output_prefix] [--cols N]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Creates `thumbnails.jpg` with slide filenames as labels. Default 3 columns, max 12 per grid.
|
|
96
|
+
|
|
97
|
+
**Use for template analysis only** (choosing layouts). For visual QA, use `soffice` + `pdftoppm` to create full-resolution individual slide images—see SKILL.md.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Slide Operations
|
|
102
|
+
|
|
103
|
+
Slide order is in `ppt/presentation.xml` → `<p:sldIdLst>`.
|
|
104
|
+
|
|
105
|
+
**Reorder**: Rearrange `<p:sldId>` elements.
|
|
106
|
+
|
|
107
|
+
**Delete**: Remove `<p:sldId>`, then run `clean.py`.
|
|
108
|
+
|
|
109
|
+
**Add**: Use `add_slide.py`. Never manually copy slide files—the script handles notes references, Content_Types.xml, and relationship IDs that manual copying misses.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Editing Content
|
|
114
|
+
|
|
115
|
+
**Subagents:** If available, use them here (after completing step 4). Each slide is a separate XML file, so subagents can edit in parallel. In your prompt to subagents, include:
|
|
116
|
+
- The slide file path(s) to edit
|
|
117
|
+
- **"Use the Edit tool for all changes"**
|
|
118
|
+
- The formatting rules and common pitfalls below
|
|
119
|
+
|
|
120
|
+
For each slide:
|
|
121
|
+
1. Read the slide's XML
|
|
122
|
+
2. Identify ALL placeholder content—text, images, charts, icons, captions
|
|
123
|
+
3. Replace each placeholder with final content
|
|
124
|
+
|
|
125
|
+
**Use the Edit tool, not sed or Python scripts.** The Edit tool forces specificity about what to replace and where, yielding better reliability.
|
|
126
|
+
|
|
127
|
+
### Formatting Rules
|
|
128
|
+
|
|
129
|
+
- **Bold all headers, subheadings, and inline labels**: Use `b="1"` on `<a:rPr>`. This includes:
|
|
130
|
+
- Slide titles
|
|
131
|
+
- Section headers within a slide
|
|
132
|
+
- Inline labels like (e.g.: "Status:", "Description:") at the start of a line
|
|
133
|
+
- **Never use unicode bullets (•)**: Use proper list formatting with `<a:buChar>` or `<a:buAutoNum>`
|
|
134
|
+
- **Bullet consistency**: Let bullets inherit from the layout. Only specify `<a:buChar>` or `<a:buNone>`.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Common Pitfalls
|
|
139
|
+
|
|
140
|
+
### Template Adaptation
|
|
141
|
+
|
|
142
|
+
When source content has fewer items than the template:
|
|
143
|
+
- **Remove excess elements entirely** (images, shapes, text boxes), don't just clear text
|
|
144
|
+
- Check for orphaned visuals after clearing text content
|
|
145
|
+
- Run visual QA to catch mismatched counts
|
|
146
|
+
|
|
147
|
+
When replacing text with different length content:
|
|
148
|
+
- **Shorter replacements**: Usually safe
|
|
149
|
+
- **Longer replacements**: May overflow or wrap unexpectedly
|
|
150
|
+
- Test with visual QA after text changes
|
|
151
|
+
- Consider truncating or splitting content to fit the template's design constraints
|
|
152
|
+
|
|
153
|
+
**Template slots ≠ Source items**: If template has 4 team members but source has 3 users, delete the 4th member's entire group (image + text boxes), not just the text.
|
|
154
|
+
|
|
155
|
+
### Multi-Item Content
|
|
156
|
+
|
|
157
|
+
If source has multiple items (numbered lists, multiple sections), create separate `<a:p>` elements for each — **never concatenate into one string**.
|
|
158
|
+
|
|
159
|
+
**❌ WRONG** — all items in one paragraph:
|
|
160
|
+
```xml
|
|
161
|
+
<a:p>
|
|
162
|
+
<a:r><a:rPr .../><a:t>Step 1: Do the first thing. Step 2: Do the second thing.</a:t></a:r>
|
|
163
|
+
</a:p>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**✅ CORRECT** — separate paragraphs with bold headers:
|
|
167
|
+
```xml
|
|
168
|
+
<a:p>
|
|
169
|
+
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
|
|
170
|
+
<a:r><a:rPr lang="en-US" sz="2799" b="1" .../><a:t>Step 1</a:t></a:r>
|
|
171
|
+
</a:p>
|
|
172
|
+
<a:p>
|
|
173
|
+
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
|
|
174
|
+
<a:r><a:rPr lang="en-US" sz="2799" .../><a:t>Do the first thing.</a:t></a:r>
|
|
175
|
+
</a:p>
|
|
176
|
+
<a:p>
|
|
177
|
+
<a:pPr algn="l"><a:lnSpc><a:spcPts val="3919"/></a:lnSpc></a:pPr>
|
|
178
|
+
<a:r><a:rPr lang="en-US" sz="2799" b="1" .../><a:t>Step 2</a:t></a:r>
|
|
179
|
+
</a:p>
|
|
180
|
+
<!-- continue pattern -->
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Copy `<a:pPr>` from the original paragraph to preserve line spacing. Use `b="1"` on headers.
|
|
184
|
+
|
|
185
|
+
### Smart Quotes
|
|
186
|
+
|
|
187
|
+
Handled automatically by unpack/pack. But the Edit tool converts smart quotes to ASCII.
|
|
188
|
+
|
|
189
|
+
**When adding new text with quotes, use XML entities:**
|
|
190
|
+
|
|
191
|
+
```xml
|
|
192
|
+
<a:t>the “Agreement”</a:t>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
| Character | Name | Unicode | XML Entity |
|
|
196
|
+
|-----------|------|---------|------------|
|
|
197
|
+
| `“` | Left double quote | U+201C | `“` |
|
|
198
|
+
| `”` | Right double quote | U+201D | `”` |
|
|
199
|
+
| `‘` | Left single quote | U+2018 | `‘` |
|
|
200
|
+
| `’` | Right single quote | U+2019 | `’` |
|
|
201
|
+
|
|
202
|
+
### Other
|
|
203
|
+
|
|
204
|
+
- **Whitespace**: Use `xml:space="preserve"` on `<a:t>` with leading/trailing spaces
|
|
205
|
+
- **XML parsing**: Use `defusedxml.minidom`, not `xml.etree.ElementTree` (corrupts namespaces)
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
# PptxGenJS Tutorial
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Setup & Basic Structure
|
|
5
|
+
|
|
6
|
+
**IMPORTANT: Always save files to `/home/user/task/` directory for automatic S3 sync.**
|
|
7
|
+
|
|
8
|
+
```javascript
|
|
9
|
+
const pptxgen = require("pptxgenjs");
|
|
10
|
+
|
|
11
|
+
let pres = new pptxgen();
|
|
12
|
+
pres.layout = 'LAYOUT_16x9'; // or 'LAYOUT_16x10', 'LAYOUT_4x3', 'LAYOUT_WIDE'
|
|
13
|
+
pres.author = 'Your Name';
|
|
14
|
+
pres.title = 'Presentation Title';
|
|
15
|
+
|
|
16
|
+
let slide = pres.addSlide();
|
|
17
|
+
slide.addText("Hello World!", { x: 0.5, y: 0.5, fontSize: 36, color: "363636" });
|
|
18
|
+
|
|
19
|
+
// IMPORTANT: Save to /home/user/task/ for S3 sync
|
|
20
|
+
pres.writeFile({ fileName: "/home/user/task/Presentation.pptx" });
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Layout Dimensions
|
|
24
|
+
|
|
25
|
+
Slide dimensions (coordinates in inches):
|
|
26
|
+
- `LAYOUT_16x9`: 10" × 5.625" (default)
|
|
27
|
+
- `LAYOUT_16x10`: 10" × 6.25"
|
|
28
|
+
- `LAYOUT_4x3`: 10" × 7.5"
|
|
29
|
+
- `LAYOUT_WIDE`: 13.3" × 7.5"
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Text & Formatting
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
// Basic text
|
|
37
|
+
slide.addText("Simple Text", {
|
|
38
|
+
x: 1, y: 1, w: 8, h: 2, fontSize: 24, fontFace: "Arial",
|
|
39
|
+
color: "363636", bold: true, align: "center", valign: "middle"
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Rich text arrays
|
|
43
|
+
slide.addText([
|
|
44
|
+
{ text: "Bold ", options: { bold: true } },
|
|
45
|
+
{ text: "Italic ", options: { italic: true } }
|
|
46
|
+
], { x: 1, y: 3, w: 8, h: 1 });
|
|
47
|
+
|
|
48
|
+
// Multi-line text (requires breakLine: true)
|
|
49
|
+
slide.addText([
|
|
50
|
+
{ text: "Line 1", options: { breakLine: true } },
|
|
51
|
+
{ text: "Line 2", options: { breakLine: true } },
|
|
52
|
+
{ text: "Line 3" } // Last item doesn't need breakLine
|
|
53
|
+
], { x: 0.5, y: 0.5, w: 8, h: 2 });
|
|
54
|
+
|
|
55
|
+
// Text box margin (internal padding)
|
|
56
|
+
slide.addText("Title", {
|
|
57
|
+
x: 0.5, y: 0.3, w: 9, h: 0.6,
|
|
58
|
+
margin: 0 // Use 0 when aligning text with other elements like shapes or icons
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Tip:** Text boxes have internal margin by default. Set `margin: 0` when you need text to align precisely with shapes, lines, or icons at the same x-position.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Lists & Bullets
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
// ✅ CORRECT: Multiple bullets
|
|
70
|
+
slide.addText([
|
|
71
|
+
{ text: "First item", options: { bullet: true, breakLine: true } },
|
|
72
|
+
{ text: "Second item", options: { bullet: true, breakLine: true } },
|
|
73
|
+
{ text: "Third item", options: { bullet: true } }
|
|
74
|
+
], { x: 0.5, y: 0.5, w: 8, h: 3 });
|
|
75
|
+
|
|
76
|
+
// ❌ WRONG: Never use unicode bullets
|
|
77
|
+
slide.addText("• First item", { ... }); // Creates double bullets
|
|
78
|
+
|
|
79
|
+
// Sub-items and numbered lists
|
|
80
|
+
{ text: "Sub-item", options: { bullet: true, indentLevel: 1 } }
|
|
81
|
+
{ text: "First", options: { bullet: { type: "number" }, breakLine: true } }
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Shapes
|
|
87
|
+
|
|
88
|
+
```javascript
|
|
89
|
+
slide.addShape(pres.shapes.RECTANGLE, {
|
|
90
|
+
x: 0.5, y: 0.8, w: 1.5, h: 3.0,
|
|
91
|
+
fill: { color: "FF0000" }, line: { color: "000000", width: 2 }
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
slide.addShape(pres.shapes.OVAL, { x: 4, y: 1, w: 2, h: 2, fill: { color: "0000FF" } });
|
|
95
|
+
|
|
96
|
+
slide.addShape(pres.shapes.LINE, {
|
|
97
|
+
x: 1, y: 3, w: 5, h: 0, line: { color: "FF0000", width: 3, dashType: "dash" }
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// With transparency
|
|
101
|
+
slide.addShape(pres.shapes.RECTANGLE, {
|
|
102
|
+
x: 1, y: 1, w: 3, h: 2,
|
|
103
|
+
fill: { color: "0088CC", transparency: 50 }
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Note**: Gradient fills are not natively supported. Use a gradient image as a background instead.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Images
|
|
112
|
+
|
|
113
|
+
### Image Sources
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
// From file path
|
|
117
|
+
slide.addImage({ path: "images/chart.png", x: 1, y: 1, w: 5, h: 3 });
|
|
118
|
+
|
|
119
|
+
// From URL
|
|
120
|
+
slide.addImage({ path: "https://example.com/image.jpg", x: 1, y: 1, w: 5, h: 3 });
|
|
121
|
+
|
|
122
|
+
// From base64 (faster, no file I/O)
|
|
123
|
+
slide.addImage({ data: "image/png;base64,iVBORw0KGgo...", x: 1, y: 1, w: 5, h: 3 });
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Image Options
|
|
127
|
+
|
|
128
|
+
```javascript
|
|
129
|
+
slide.addImage({
|
|
130
|
+
path: "image.png",
|
|
131
|
+
x: 1, y: 1, w: 5, h: 3,
|
|
132
|
+
rotate: 45, // 0-359 degrees
|
|
133
|
+
rounding: true, // Circular crop
|
|
134
|
+
transparency: 50, // 0-100
|
|
135
|
+
flipH: true, // Horizontal flip
|
|
136
|
+
flipV: false, // Vertical flip
|
|
137
|
+
altText: "Description", // Accessibility
|
|
138
|
+
hyperlink: { url: "https://example.com" }
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Image Sizing Modes
|
|
143
|
+
|
|
144
|
+
```javascript
|
|
145
|
+
// Contain - fit inside, preserve ratio
|
|
146
|
+
{ sizing: { type: 'contain', w: 4, h: 3 } }
|
|
147
|
+
|
|
148
|
+
// Cover - fill area, preserve ratio (may crop)
|
|
149
|
+
{ sizing: { type: 'cover', w: 4, h: 3 } }
|
|
150
|
+
|
|
151
|
+
// Crop - cut specific portion
|
|
152
|
+
{ sizing: { type: 'crop', x: 0.5, y: 0.5, w: 2, h: 2 } }
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Calculate Dimensions (preserve aspect ratio)
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
const origWidth = 1978, origHeight = 923, maxHeight = 3.0;
|
|
159
|
+
const calcWidth = maxHeight * (origWidth / origHeight);
|
|
160
|
+
const centerX = (10 - calcWidth) / 2;
|
|
161
|
+
|
|
162
|
+
slide.addImage({ path: "image.png", x: centerX, y: 1.2, w: calcWidth, h: maxHeight });
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Supported Formats
|
|
166
|
+
|
|
167
|
+
- **Standard**: PNG, JPG, GIF (animated GIFs work in Microsoft 365)
|
|
168
|
+
- **SVG**: Works in modern PowerPoint/Microsoft 365
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Icons
|
|
173
|
+
|
|
174
|
+
Use react-icons to generate SVG icons, then rasterize to PNG for universal compatibility.
|
|
175
|
+
|
|
176
|
+
### Setup
|
|
177
|
+
|
|
178
|
+
```javascript
|
|
179
|
+
const React = require("react");
|
|
180
|
+
const ReactDOMServer = require("react-dom/server");
|
|
181
|
+
const sharp = require("sharp");
|
|
182
|
+
const { FaCheckCircle, FaChartLine } = require("react-icons/fa");
|
|
183
|
+
|
|
184
|
+
function renderIconSvg(IconComponent, color = "#000000", size = 256) {
|
|
185
|
+
return ReactDOMServer.renderToStaticMarkup(
|
|
186
|
+
React.createElement(IconComponent, { color, size: String(size) })
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function iconToBase64Png(IconComponent, color, size = 256) {
|
|
191
|
+
const svg = renderIconSvg(IconComponent, color, size);
|
|
192
|
+
const pngBuffer = await sharp(Buffer.from(svg)).png().toBuffer();
|
|
193
|
+
return "image/png;base64," + pngBuffer.toString("base64");
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Add Icon to Slide
|
|
198
|
+
|
|
199
|
+
```javascript
|
|
200
|
+
const iconData = await iconToBase64Png(FaCheckCircle, "#4472C4", 256);
|
|
201
|
+
|
|
202
|
+
slide.addImage({
|
|
203
|
+
data: iconData,
|
|
204
|
+
x: 1, y: 1, w: 0.5, h: 0.5 // Size in inches
|
|
205
|
+
});
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Note**: Use size 256 or higher for crisp icons. The size parameter controls the rasterization resolution, not the display size on the slide (which is set by `w` and `h` in inches).
|
|
209
|
+
|
|
210
|
+
### Icon Libraries
|
|
211
|
+
|
|
212
|
+
Install: `npm install -g react-icons react react-dom sharp`
|
|
213
|
+
|
|
214
|
+
Popular icon sets in react-icons:
|
|
215
|
+
- `react-icons/fa` - Font Awesome
|
|
216
|
+
- `react-icons/md` - Material Design
|
|
217
|
+
- `react-icons/hi` - Heroicons
|
|
218
|
+
- `react-icons/bi` - Bootstrap Icons
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Slide Backgrounds
|
|
223
|
+
|
|
224
|
+
```javascript
|
|
225
|
+
// Solid color
|
|
226
|
+
slide.background = { color: "F1F1F1" };
|
|
227
|
+
|
|
228
|
+
// Color with transparency
|
|
229
|
+
slide.background = { color: "FF3399", transparency: 50 };
|
|
230
|
+
|
|
231
|
+
// Image from URL
|
|
232
|
+
slide.background = { path: "https://example.com/bg.jpg" };
|
|
233
|
+
|
|
234
|
+
// Image from base64
|
|
235
|
+
slide.background = { data: "image/png;base64,iVBORw0KGgo..." };
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Tables
|
|
241
|
+
|
|
242
|
+
```javascript
|
|
243
|
+
slide.addTable([
|
|
244
|
+
["Header 1", "Header 2"],
|
|
245
|
+
["Cell 1", "Cell 2"]
|
|
246
|
+
], {
|
|
247
|
+
x: 1, y: 1, w: 8, h: 2,
|
|
248
|
+
border: { pt: 1, color: "999999" }, fill: { color: "F1F1F1" }
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
// Advanced with merged cells
|
|
252
|
+
let tableData = [
|
|
253
|
+
[{ text: "Header", options: { fill: { color: "6699CC" }, color: "FFFFFF", bold: true } }, "Cell"],
|
|
254
|
+
[{ text: "Merged", options: { colspan: 2 } }]
|
|
255
|
+
];
|
|
256
|
+
slide.addTable(tableData, { x: 1, y: 3.5, w: 8, colW: [4, 4] });
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Charts
|
|
262
|
+
|
|
263
|
+
```javascript
|
|
264
|
+
// Bar chart
|
|
265
|
+
slide.addChart(pres.charts.BAR, [{
|
|
266
|
+
name: "Sales", labels: ["Q1", "Q2", "Q3", "Q4"], values: [4500, 5500, 6200, 7100]
|
|
267
|
+
}], {
|
|
268
|
+
x: 0.5, y: 0.6, w: 6, h: 3, barDir: 'col',
|
|
269
|
+
showTitle: true, title: 'Quarterly Sales'
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// Line chart
|
|
273
|
+
slide.addChart(pres.charts.LINE, [{
|
|
274
|
+
name: "Temp", labels: ["Jan", "Feb", "Mar"], values: [32, 35, 42]
|
|
275
|
+
}], { x: 0.5, y: 4, w: 6, h: 3, lineSize: 3, lineSmooth: true });
|
|
276
|
+
|
|
277
|
+
// Pie chart
|
|
278
|
+
slide.addChart(pres.charts.PIE, [{
|
|
279
|
+
name: "Share", labels: ["A", "B", "Other"], values: [35, 45, 20]
|
|
280
|
+
}], { x: 7, y: 1, w: 5, h: 4, showPercent: true });
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Better-Looking Charts
|
|
284
|
+
|
|
285
|
+
Default charts look dated. Apply these options for a modern, clean appearance:
|
|
286
|
+
|
|
287
|
+
```javascript
|
|
288
|
+
slide.addChart(pres.charts.BAR, chartData, {
|
|
289
|
+
x: 0.5, y: 1, w: 9, h: 4, barDir: "col",
|
|
290
|
+
|
|
291
|
+
// Custom colors (match your presentation palette)
|
|
292
|
+
chartColors: ["0D9488", "14B8A6", "5EEAD4"],
|
|
293
|
+
|
|
294
|
+
// Clean background
|
|
295
|
+
chartArea: { fill: { color: "FFFFFF" }, roundedCorners: true },
|
|
296
|
+
|
|
297
|
+
// Muted axis labels
|
|
298
|
+
catAxisLabelColor: "64748B",
|
|
299
|
+
valAxisLabelColor: "64748B",
|
|
300
|
+
|
|
301
|
+
// Subtle grid (value axis only)
|
|
302
|
+
valGridLine: { color: "E2E8F0", size: 0.5 },
|
|
303
|
+
catGridLine: { style: "none" },
|
|
304
|
+
|
|
305
|
+
// Data labels on bars
|
|
306
|
+
showValue: true,
|
|
307
|
+
dataLabelPosition: "outEnd",
|
|
308
|
+
dataLabelColor: "1E293B",
|
|
309
|
+
|
|
310
|
+
// Hide legend for single series
|
|
311
|
+
showLegend: false,
|
|
312
|
+
});
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**Key styling options:**
|
|
316
|
+
- `chartColors: [...]` - hex colors for series/segments
|
|
317
|
+
- `chartArea: { fill, border, roundedCorners }` - chart background
|
|
318
|
+
- `catGridLine/valGridLine: { color, style, size }` - grid lines (`style: "none"` to hide)
|
|
319
|
+
- `lineSmooth: true` - curved lines (line charts)
|
|
320
|
+
- `legendPos: "r"` - legend position: "b", "t", "l", "r", "tr"
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Slide Masters
|
|
325
|
+
|
|
326
|
+
```javascript
|
|
327
|
+
pres.defineSlideMaster({
|
|
328
|
+
title: 'TITLE_SLIDE', background: { color: '283A5E' },
|
|
329
|
+
objects: [{
|
|
330
|
+
placeholder: { options: { name: 'title', type: 'title', x: 1, y: 2, w: 8, h: 2 } }
|
|
331
|
+
}]
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
let titleSlide = pres.addSlide({ masterName: "TITLE_SLIDE" });
|
|
335
|
+
titleSlide.addText("My Title", { placeholder: "title" });
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Common Pitfalls
|
|
341
|
+
|
|
342
|
+
⚠️ These issues cause file corruption, visual bugs, or broken output. Avoid them.
|
|
343
|
+
|
|
344
|
+
1. **NEVER use "#" with hex colors** - causes file corruption
|
|
345
|
+
```javascript
|
|
346
|
+
color: "FF0000" // ✅ CORRECT
|
|
347
|
+
color: "#FF0000" // ❌ WRONG
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
2. **Use `bullet: true`** - NEVER unicode symbols like "•" (creates double bullets)
|
|
351
|
+
|
|
352
|
+
3. **Use `breakLine: true`** between array items or text runs together
|
|
353
|
+
|
|
354
|
+
4. **Avoid `lineSpacing` with bullets** - causes excessive gaps; use `paraSpaceAfter` instead
|
|
355
|
+
|
|
356
|
+
5. **Each presentation needs fresh instance** - don't reuse `pptxgen()` objects
|
|
357
|
+
|
|
358
|
+
6. **Don't use `ROUNDED_RECTANGLE` with accent borders** - rectangular overlay bars won't cover rounded corners. Use `RECTANGLE` instead.
|
|
359
|
+
```javascript
|
|
360
|
+
// ❌ WRONG: Accent bar doesn't cover rounded corners
|
|
361
|
+
slide.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 1, y: 1, w: 3, h: 1.5, fill: { color: "FFFFFF" } });
|
|
362
|
+
slide.addShape(pres.shapes.RECTANGLE, { x: 1, y: 1, w: 0.08, h: 1.5, fill: { color: "0891B2" } });
|
|
363
|
+
|
|
364
|
+
// ✅ CORRECT: Use RECTANGLE for clean alignment
|
|
365
|
+
slide.addShape(pres.shapes.RECTANGLE, { x: 1, y: 1, w: 3, h: 1.5, fill: { color: "FFFFFF" } });
|
|
366
|
+
slide.addShape(pres.shapes.RECTANGLE, { x: 1, y: 1, w: 0.08, h: 1.5, fill: { color: "0891B2" } });
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## Quick Reference
|
|
372
|
+
|
|
373
|
+
- **Shapes**: RECTANGLE, OVAL, LINE, ROUNDED_RECTANGLE
|
|
374
|
+
- **Charts**: BAR, LINE, PIE, DOUGHNUT, SCATTER, BUBBLE, RADAR
|
|
375
|
+
- **Layouts**: LAYOUT_16x9 (10"×5.625"), LAYOUT_16x10, LAYOUT_4x3, LAYOUT_WIDE
|
|
376
|
+
- **Alignment**: "left", "center", "right"
|
|
377
|
+
- **Chart data labels**: "outEnd", "inEnd", "center"
|