@nguyenphp/antigravity-marketing 1.0.18 → 1.0.19
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/README.md +186 -78
- package/package.json +4 -3
- package/templates/.agent/skills/marketing-report-expert/SKILL.md +70 -0
- package/templates/.agent/skills/minimax-docx/LICENSE +21 -0
- package/templates/.agent/skills/minimax-docx/SKILL.md +274 -0
- package/templates/.agent/skills/minimax-docx/assets/styles/academic_styles.xml +250 -0
- package/templates/.agent/skills/minimax-docx/assets/styles/corporate_styles.xml +284 -0
- package/templates/.agent/skills/minimax-docx/assets/styles/default_styles.xml +449 -0
- package/templates/.agent/skills/minimax-docx/assets/xsd/aesthetic-rules.xsd +470 -0
- package/templates/.agent/skills/minimax-docx/assets/xsd/business-rules.xsd +130 -0
- package/templates/.agent/skills/minimax-docx/assets/xsd/common-types.xsd +159 -0
- package/templates/.agent/skills/minimax-docx/assets/xsd/wml-subset.xsd +589 -0
- package/templates/.agent/skills/minimax-docx/references/cjk_typography.md +357 -0
- package/templates/.agent/skills/minimax-docx/references/cjk_university_template_guide.md +184 -0
- package/templates/.agent/skills/minimax-docx/references/comments_guide.md +191 -0
- package/templates/.agent/skills/minimax-docx/references/design_good_bad_examples.md +829 -0
- package/templates/.agent/skills/minimax-docx/references/design_principles.md +819 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_element_order.md +308 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part1.md +4061 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part2.md +2820 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part3.md +3381 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_namespaces.md +82 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_units.md +72 -0
- package/templates/.agent/skills/minimax-docx/references/scenario_a_create.md +284 -0
- package/templates/.agent/skills/minimax-docx/references/scenario_b_edit_content.md +295 -0
- package/templates/.agent/skills/minimax-docx/references/scenario_c_apply_template.md +456 -0
- package/templates/.agent/skills/minimax-docx/references/track_changes_guide.md +200 -0
- package/templates/.agent/skills/minimax-docx/references/troubleshooting.md +506 -0
- package/templates/.agent/skills/minimax-docx/references/typography_guide.md +294 -0
- package/templates/.agent/skills/minimax-docx/references/xsd_validation_guide.md +158 -0
- package/templates/.agent/skills/minimax-docx/scripts/doc_to_docx.sh +40 -0
- package/templates/.agent/skills/minimax-docx/scripts/docx_preview.sh +37 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/MiniMaxAIDocx.Cli.csproj +19 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/Program.cs +18 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/AnalyzeCommand.cs +147 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ApplyTemplateCommand.cs +322 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/CreateCommand.cs +324 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/DiffCommand.cs +155 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/EditContentCommand.cs +487 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/FixOrderCommand.cs +108 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/MergeRunsCommand.cs +122 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ValidateCommand.cs +107 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/MiniMaxAIDocx.Core.csproj +15 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/CommentSynchronizer.cs +169 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/ElementOrder.cs +80 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/NamespaceConstants.cs +42 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/RunMerger.cs +81 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/StyleAnalyzer.cs +81 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/TrackChangesHelper.cs +99 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/UnitConverter.cs +23 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples.cs +1832 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch1.cs +910 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch2.cs +999 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch3.cs +1048 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch4.cs +1038 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/CharacterFormattingSamples.cs +1020 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/DocumentCreationSamples.cs +1121 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FieldAndTocSamples.cs +624 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FootnoteAndCommentSamples.cs +675 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/HeaderFooterSamples.cs +838 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ImageSamples.cs +917 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ListAndNumberingSamples.cs +826 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ParagraphFormattingSamples.cs +1199 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/StyleSystemSamples.cs +1487 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TableSamples.cs +1163 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TrackChangesSamples.cs +595 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/CjkHelper.cs +39 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/FontDefaults.cs +24 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/PageSizes.cs +20 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/BusinessRuleValidator.cs +224 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/GateCheckValidator.cs +148 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/ValidationResult.cs +23 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/XsdValidator.cs +69 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.slnx +4 -0
- package/templates/.agent/skills/minimax-docx/scripts/env_check.sh +196 -0
- package/templates/.agent/skills/minimax-docx/scripts/setup.ps1 +274 -0
- package/templates/.agent/skills/minimax-docx/scripts/setup.sh +504 -0
- package/templates/.agent/skills/minimax-multimodal-toolkit/SKILL.md +359 -0
- package/templates/.agent/skills/minimax-pdf/README.md +222 -0
- package/templates/.agent/skills/minimax-pdf/SKILL.md +201 -0
- package/templates/.agent/skills/minimax-pdf/design/design.md +381 -0
- package/templates/.agent/skills/minimax-pdf/scripts/cover.py +1579 -0
- package/templates/.agent/skills/minimax-pdf/scripts/fill_inspect.py +200 -0
- package/templates/.agent/skills/minimax-pdf/scripts/fill_write.py +242 -0
- package/templates/.agent/skills/minimax-pdf/scripts/make.sh +491 -0
- package/templates/.agent/skills/minimax-pdf/scripts/merge.py +112 -0
- package/templates/.agent/skills/minimax-pdf/scripts/palette.py +559 -0
- package/templates/.agent/skills/minimax-pdf/scripts/reformat_parse.py +374 -0
- package/templates/.agent/skills/minimax-pdf/scripts/render_body.py +1055 -0
- package/templates/.agent/skills/minimax-pdf/scripts/render_cover.cjs +111 -0
- package/templates/.agent/skills/minimax-xlsx/SKILL.md +138 -0
- package/templates/.agent/skills/minimax-xlsx/references/create.md +691 -0
- package/templates/.agent/skills/minimax-xlsx/references/edit.md +684 -0
- package/templates/.agent/skills/minimax-xlsx/references/fix.md +37 -0
- package/templates/.agent/skills/minimax-xlsx/references/format.md +768 -0
- package/templates/.agent/skills/minimax-xlsx/references/ooxml-cheatsheet.md +231 -0
- package/templates/.agent/skills/minimax-xlsx/references/read-analyze.md +97 -0
- package/templates/.agent/skills/minimax-xlsx/references/validate.md +772 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/formula_check.py +422 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/libreoffice_recalc.py +248 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/shared_strings_builder.py +163 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/style_audit.py +575 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_add_column.py +395 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_insert_row.py +274 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_pack.py +87 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_reader.py +362 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_shift_rows.py +396 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_unpack.py +130 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/[Content_Types].xml +9 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/_rels/.rels +6 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +19 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +33 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/styles.xml +160 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/workbook.xml +30 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +70 -0
- package/templates/.agent/skills/pptx-generator/SKILL.md +249 -0
- package/templates/.agent/skills/pptx-generator/references/design-system.md +392 -0
- package/templates/.agent/skills/pptx-generator/references/editing.md +162 -0
- package/templates/.agent/skills/pptx-generator/references/pitfalls.md +112 -0
- package/templates/.agent/skills/pptx-generator/references/pptxgenjs.md +420 -0
- package/templates/.agent/skills/pptx-generator/references/slide-types.md +413 -0
- package/templates/.agent/skills/tutorial-video-expert/SKILL.md +88 -0
- package/templates/.agent/skills/ui-ux-pro-max/SKILL.md +170 -585
- package/templates/.agent/skills/vision-analysis/SKILL.md +174 -0
- package/templates/.agent/workflows/analyze.md +3 -0
- package/templates/.agent/workflows/brand-report.md +44 -0
- package/templates/.agent/workflows/report.md +49 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# Professional Document Design & Typography Guide
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
1. [Font Pairing](#font-pairing)
|
|
5
|
+
2. [Font Sizes by Document Type](#font-sizes-by-document-type)
|
|
6
|
+
3. [Line Spacing](#line-spacing)
|
|
7
|
+
4. [Paragraph Spacing](#paragraph-spacing)
|
|
8
|
+
5. [Page Layout](#page-layout)
|
|
9
|
+
6. [Table Design](#table-design)
|
|
10
|
+
7. [Color Schemes](#color-schemes)
|
|
11
|
+
8. [Visual Hierarchy](#visual-hierarchy)
|
|
12
|
+
9. [Quick Reference Defaults](#quick-reference-defaults)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Font Pairing
|
|
17
|
+
|
|
18
|
+
### Recommended Pairs
|
|
19
|
+
|
|
20
|
+
| Headings | Body | Style | Best For |
|
|
21
|
+
|----------|------|-------|----------|
|
|
22
|
+
| Calibri Light | Calibri | Modern sans | Corporate reports |
|
|
23
|
+
| Aptos | Aptos | Office 365 default | Modern business docs |
|
|
24
|
+
| Cambria | Calibri | Serif + sans | Academic-corporate hybrid |
|
|
25
|
+
| Times New Roman | Times New Roman | Traditional serif | Academic, legal |
|
|
26
|
+
| Arial | Arial | Clean sans | Memos, internal docs |
|
|
27
|
+
| Georgia | Garamond | Classical serif pair | Formal reports |
|
|
28
|
+
|
|
29
|
+
### Rules
|
|
30
|
+
|
|
31
|
+
- **Limit**: 2 font families max (3 if CJK mixed)
|
|
32
|
+
- **Contrast**: Pair serif with sans-serif, OR use weight contrast within one family
|
|
33
|
+
- **Consistency**: Same font for all body text, same font for all headings
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Font Sizes by Document Type
|
|
38
|
+
|
|
39
|
+
| Document Type | Body | H1 | H2 | H3 | Footnotes |
|
|
40
|
+
|--------------|------|----|----|----|----|
|
|
41
|
+
| **Business report** | 11pt | 18-20pt | 14-16pt | 12-13pt bold | 9pt |
|
|
42
|
+
| **Business letter** | 11-12pt | — | — | — | 9-10pt |
|
|
43
|
+
| **Memo** | 11pt | 14pt bold | 12pt bold | 11pt bold | 9pt |
|
|
44
|
+
| **Contract / Legal** | 12pt | 14pt bold caps | 12pt bold | 12pt bold | 10pt |
|
|
45
|
+
| **Academic (APA 7)** | 12pt | 12pt bold center | 12pt bold left | 12pt bold italic | 10pt |
|
|
46
|
+
| **Resume / CV** | 10-11pt | 14-16pt | 12pt bold | 11pt bold | 8-9pt |
|
|
47
|
+
| **Chinese 公文** | 三号(16pt) | 二号(22pt) | 三号(16pt) | 四号(14pt) | 小四(12pt) |
|
|
48
|
+
|
|
49
|
+
### OpenXML `w:sz` Values (half-points)
|
|
50
|
+
|
|
51
|
+
| Point Size | `w:sz` Val | Common Use |
|
|
52
|
+
|-----------|-----------|------------|
|
|
53
|
+
| 9pt | 18 | Footnotes, captions |
|
|
54
|
+
| 10pt | 20 | Compact body text |
|
|
55
|
+
| 10.5pt (五号) | 21 | CJK body small |
|
|
56
|
+
| 11pt | 22 | Standard body (Calibri) |
|
|
57
|
+
| 12pt (小四) | 24 | Standard body (TNR), CJK |
|
|
58
|
+
| 14pt (四号) | 28 | CJK body, subheading |
|
|
59
|
+
| 16pt (三号) | 32 | CJK heading, western H2 |
|
|
60
|
+
| 18pt (小二) | 36 | Western H1 |
|
|
61
|
+
| 22pt (二号) | 44 | CJK document title |
|
|
62
|
+
| 26pt (一号) | 52 | Large title |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Line Spacing
|
|
67
|
+
|
|
68
|
+
| Spacing | OpenXML `w:spacing line` | When to Use |
|
|
69
|
+
|---------|--------------------------|-------------|
|
|
70
|
+
| Single (1.0) | `line="240"` lineRule="auto" | Tables, footnotes, captions |
|
|
71
|
+
| 1.08 (MS default) | `line="259"` lineRule="auto" | Modern Office documents |
|
|
72
|
+
| 1.15 | `line="276"` lineRule="auto" | Business reports — best general default |
|
|
73
|
+
| 1.5 | `line="360"` lineRule="auto" | Some academic, drafts for markup |
|
|
74
|
+
| Double (2.0) | `line="480"` lineRule="auto" | APA/MLA manuscripts, legal briefs |
|
|
75
|
+
| Fixed 28pt | `line="560"` lineRule="exact" | Chinese 公文 (GB/T 9704) |
|
|
76
|
+
|
|
77
|
+
**`lineRule` values**: `auto` = proportional (240 = 1 line), `exact` = fixed height, `atLeast` = minimum.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Paragraph Spacing
|
|
82
|
+
|
|
83
|
+
| Element | Space Before (DXA) | Space After (DXA) |
|
|
84
|
+
|---------|-------------------|-------------------|
|
|
85
|
+
| Body paragraph | 0 | 120-160 (6-8pt) |
|
|
86
|
+
| Heading 1 | 480 (24pt) | 120-240 |
|
|
87
|
+
| Heading 2 | 360 (18pt) | 120 |
|
|
88
|
+
| Heading 3 | 240 (12pt) | 80-120 |
|
|
89
|
+
| List items | 0 | 40-80 (2-4pt) |
|
|
90
|
+
| Block quote | 120-240 | 120-240 |
|
|
91
|
+
| Table/Figure caption | 240 | 240 |
|
|
92
|
+
|
|
93
|
+
**Principle**: Space before a heading > space after, so heading visually "belongs to" content below (2:1 or 3:1 ratio).
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Page Layout
|
|
98
|
+
|
|
99
|
+
### Margins by Document Type
|
|
100
|
+
|
|
101
|
+
| Document Type | Top | Bottom | Left | Right | DXA Values |
|
|
102
|
+
|--------------|-----|--------|------|-------|------------|
|
|
103
|
+
| **Standard business** | 1 in | 1 in | 1 in | 1 in | 1440 all |
|
|
104
|
+
| **Academic (APA/MLA)** | 1 in | 1 in | 1 in | 1 in | 1440 all |
|
|
105
|
+
| **Thesis (binding)** | 1 in | 1 in | 1.5 in | 1 in | T/B:1440 L:2160 R:1440 |
|
|
106
|
+
| **Chinese 公文** | 37mm | 35mm | 28mm | 26mm | T:2098 B:1984 L:1588 R:1474 |
|
|
107
|
+
| **Narrow modern** | 0.75 in | 0.75 in | 0.75 in | 0.75 in | 1080 all |
|
|
108
|
+
| **Wide** | 1 in | 1 in | 2 in | 2 in | T/B:1440 L/R:2880 |
|
|
109
|
+
|
|
110
|
+
### Page Sizes
|
|
111
|
+
|
|
112
|
+
| Size | Width × Height | DXA Width × Height |
|
|
113
|
+
|------|---------------|-------------------|
|
|
114
|
+
| US Letter | 8.5 × 11 in | 12240 × 15840 |
|
|
115
|
+
| A4 | 210 × 297 mm | 11906 × 16838 |
|
|
116
|
+
| Legal | 8.5 × 14 in | 12240 × 20160 |
|
|
117
|
+
| A3 | 297 × 420 mm | 16838 × 23811 |
|
|
118
|
+
|
|
119
|
+
**Rule**: A4 for international audiences, Letter for US-only.
|
|
120
|
+
|
|
121
|
+
### Page Numbers
|
|
122
|
+
|
|
123
|
+
| Convention | Placement | Common In |
|
|
124
|
+
|-----------|-----------|-----------|
|
|
125
|
+
| Bottom center | Footer, centered | Academic, government |
|
|
126
|
+
| Bottom right | Footer, right-aligned | Business reports |
|
|
127
|
+
| "Page X of Y" | Footer, right-aligned | Contracts, legal |
|
|
128
|
+
| Bottom outside | Alternating L/R for odd/even | Books, bound reports |
|
|
129
|
+
| Chinese 公文 | Bottom center, format "-X-" | Government documents |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Table Design
|
|
134
|
+
|
|
135
|
+
### Style Patterns
|
|
136
|
+
|
|
137
|
+
| Style | Description | When to Use |
|
|
138
|
+
|-------|------------|-------------|
|
|
139
|
+
| **Three-line (三线表)** | Top rule + header-bottom rule + bottom rule only, no vertical lines | Academic, scientific — gold standard |
|
|
140
|
+
| **Banded rows** | Alternating white/light-gray, no borders | Modern corporate |
|
|
141
|
+
| **Light grid** | Thin 0.5pt gray borders all cells | Business reports |
|
|
142
|
+
| **Header-accent** | Dark/colored header row, no other borders | Modern templates |
|
|
143
|
+
| **Full border** | All cells bordered | Financial tables, forms |
|
|
144
|
+
|
|
145
|
+
### Border Weights (OpenXML `w:sz` in eighths of a point)
|
|
146
|
+
|
|
147
|
+
| Visual | `Size` value | Points |
|
|
148
|
+
|--------|-------------|--------|
|
|
149
|
+
| Hairline | 2 | 0.25pt |
|
|
150
|
+
| Thin | 4 | 0.5pt |
|
|
151
|
+
| Medium | 8 | 1pt |
|
|
152
|
+
| Thick | 12 | 1.5pt |
|
|
153
|
+
|
|
154
|
+
### Cell Padding
|
|
155
|
+
|
|
156
|
+
- **Minimum**: 0.05 in (28 DXA) — too tight for most uses
|
|
157
|
+
- **Recommended**: 0.08-0.1 in (57-72 DXA) top/bottom, 0.1-0.15 in (72-108 DXA) left/right
|
|
158
|
+
- **Spacious**: 0.12 in (86 DXA) top/bottom, 0.19 in (137 DXA) left/right
|
|
159
|
+
|
|
160
|
+
### Header Row Best Practices
|
|
161
|
+
|
|
162
|
+
- Bold text, optionally SMALL CAPS
|
|
163
|
+
- Background: light gray (#F2F2F2) or dark with white text (#2F5496 + white)
|
|
164
|
+
- Repeat header row on each page (`w:tblHeader` on `w:trPr`)
|
|
165
|
+
- Right-align number columns, left-align text columns
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Color Schemes
|
|
170
|
+
|
|
171
|
+
### Corporate / Business
|
|
172
|
+
|
|
173
|
+
| Element | Hex | Notes |
|
|
174
|
+
|---------|-----|-------|
|
|
175
|
+
| Primary heading | #1F3864 | Dark navy, authoritative |
|
|
176
|
+
| Secondary heading | #2E75B6 | Medium blue |
|
|
177
|
+
| Body text | #333333 | Near-black (softer than #000) |
|
|
178
|
+
| Table header bg | #4472C4 | With white #FFFFFF text |
|
|
179
|
+
| Alternate row | #F2F2F2 | Subtle gray banding |
|
|
180
|
+
| Hyperlink | #0563C1 | Standard blue |
|
|
181
|
+
|
|
182
|
+
### Academic
|
|
183
|
+
|
|
184
|
+
All text **#000000** (black). Color only in figures/charts.
|
|
185
|
+
|
|
186
|
+
### Chinese Government (公文)
|
|
187
|
+
|
|
188
|
+
| Element | Color |
|
|
189
|
+
|---------|-------|
|
|
190
|
+
| All body text | Black (required) |
|
|
191
|
+
| 红头 agency name | Red #FF0000 |
|
|
192
|
+
| 红线 separator | Red #FF0000 |
|
|
193
|
+
| 公章 seal | Red |
|
|
194
|
+
|
|
195
|
+
### Accessibility
|
|
196
|
+
|
|
197
|
+
- Minimum contrast ratio 4.5:1 for normal text, 3:1 for large text (WCAG AA)
|
|
198
|
+
- Never use color as sole means of conveying information
|
|
199
|
+
- Ensure distinguishable in grayscale for printed documents
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Visual Hierarchy
|
|
204
|
+
|
|
205
|
+
### Heading Levels by Document Length
|
|
206
|
+
|
|
207
|
+
| Pages | Recommended Levels |
|
|
208
|
+
|-------|-------------------|
|
|
209
|
+
| 1-5 (memo, letter) | 1-2 levels |
|
|
210
|
+
| 5-20 (report) | 2-3 levels |
|
|
211
|
+
| 20-100 (long report) | 3-4 levels |
|
|
212
|
+
| 100+ (thesis) | 4-5 levels max |
|
|
213
|
+
|
|
214
|
+
### Numbering Systems
|
|
215
|
+
|
|
216
|
+
**Decimal (ISO 2145)** — technical, international:
|
|
217
|
+
```
|
|
218
|
+
1 → 1.1 → 1.1.1 → 1.1.1.1
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Traditional outline (US legal):**
|
|
222
|
+
```
|
|
223
|
+
I. → A. → 1. → a. → (1) → (a)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Chinese government (公文):**
|
|
227
|
+
```
|
|
228
|
+
一、(黑体) → (一)(楷体) → 1.(仿宋加粗) → (1)(仿宋)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Typography Emphasis
|
|
232
|
+
|
|
233
|
+
| Format | Use For | Avoid |
|
|
234
|
+
|--------|---------|-------|
|
|
235
|
+
| **Bold** | Key terms, headings, emphasis | Entire paragraphs |
|
|
236
|
+
| *Italic* | Titles, foreign words, mild emphasis | Long passages (hard to read) |
|
|
237
|
+
| Underline | Hyperlinks only (digital) | General emphasis (archaic) |
|
|
238
|
+
| SMALL CAPS | Legal defined terms, acronyms | Body text |
|
|
239
|
+
| ALL CAPS | Very short headings | Long text (reduces readability 15%) |
|
|
240
|
+
|
|
241
|
+
**CJK note**: Chinese/Japanese have no true italic. Use bold for emphasis.
|
|
242
|
+
|
|
243
|
+
### List Formatting
|
|
244
|
+
|
|
245
|
+
**Bullets** (unordered): `•` → `○` → `■` by level
|
|
246
|
+
|
|
247
|
+
**Numbers** (ordered): `1.` → `a.` → `i.` by level
|
|
248
|
+
|
|
249
|
+
- Indent each level 0.25-0.5 in (360-720 DXA)
|
|
250
|
+
- Hanging indent: number hangs, text aligns consistently
|
|
251
|
+
- Spacing between items: 2-4pt (less than paragraph spacing)
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Quick Reference Defaults
|
|
256
|
+
|
|
257
|
+
### Business Report (Safe Default)
|
|
258
|
+
|
|
259
|
+
| Parameter | Value | OpenXML |
|
|
260
|
+
|-----------|-------|---------|
|
|
261
|
+
| Body font | Calibri 11pt | sz="22", RunFonts Ascii="Calibri" |
|
|
262
|
+
| H1 | 18pt Bold Dark Blue | sz="36", Bold, Color="#1F3864" |
|
|
263
|
+
| H2 | 14pt Bold Dark Blue | sz="28", Bold |
|
|
264
|
+
| H3 | 12pt Bold Dark Blue | sz="24", Bold |
|
|
265
|
+
| Line spacing | 1.15 | line="276" lineRule="auto" |
|
|
266
|
+
| Para after | 8pt | after="160" |
|
|
267
|
+
| Margins | 1 in all | 1440 DXA all |
|
|
268
|
+
| Page size | Letter or A4 | 12240×15840 or 11906×16838 |
|
|
269
|
+
| Page numbers | Bottom right, 10pt | |
|
|
270
|
+
|
|
271
|
+
### Academic Paper (APA 7th)
|
|
272
|
+
|
|
273
|
+
| Parameter | Value | OpenXML |
|
|
274
|
+
|-----------|-------|---------|
|
|
275
|
+
| Font | Times New Roman 12pt | sz="24" |
|
|
276
|
+
| Line spacing | Double | line="480" lineRule="auto" |
|
|
277
|
+
| First-line indent | 0.5 in | ind firstLine="720" |
|
|
278
|
+
| Margins | 1 in all | 1440 DXA all |
|
|
279
|
+
| Page numbers | Top right | Header, right-aligned |
|
|
280
|
+
|
|
281
|
+
### Chinese Government (公文 GB/T 9704)
|
|
282
|
+
|
|
283
|
+
| Parameter | Value | OpenXML |
|
|
284
|
+
|-----------|-------|---------|
|
|
285
|
+
| Body font | 仿宋_GB2312 三号 | sz="32", EastAsia="FangSong_GB2312" |
|
|
286
|
+
| Title | 小标宋 二号 centered | sz="44" |
|
|
287
|
+
| L1 heading | 黑体 三号 | sz="32", EastAsia="SimHei" |
|
|
288
|
+
| L2 heading | 楷体 三号 | sz="32", EastAsia="KaiTi_GB2312" |
|
|
289
|
+
| Line spacing | Fixed 28pt | line="560" lineRule="exact" |
|
|
290
|
+
| Margins | T:37mm B:35mm L:28mm R:26mm | T:2098 B:1984 L:1588 R:1474 |
|
|
291
|
+
| Page size | A4 | 11906×16838 |
|
|
292
|
+
| Page numbers | Bottom center, 宋体 四号, "-X-" | sz="28" |
|
|
293
|
+
| Chars/line | 28 | |
|
|
294
|
+
| Lines/page | 22 | |
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# XSD Validation Guide
|
|
2
|
+
|
|
3
|
+
## Running Validation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# Validate against the WML subset schema
|
|
7
|
+
dotnet run --project minimax-docx validate input.docx --xsd assets/xsd/wml-subset.xsd
|
|
8
|
+
|
|
9
|
+
# Validate against business rules (REQUIRED for Scenario C gate-check)
|
|
10
|
+
dotnet run --project minimax-docx validate input.docx --xsd assets/xsd/business-rules.xsd
|
|
11
|
+
|
|
12
|
+
# Validate against both
|
|
13
|
+
dotnet run --project minimax-docx validate input.docx --xsd assets/xsd/wml-subset.xsd --xsd assets/xsd/business-rules.xsd
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## What wml-subset.xsd Covers
|
|
19
|
+
|
|
20
|
+
The subset schema validates the most common WordprocessingML elements:
|
|
21
|
+
|
|
22
|
+
| Area | Elements Validated |
|
|
23
|
+
|------|--------------------|
|
|
24
|
+
| Document structure | `w:document`, `w:body`, `w:sectPr` |
|
|
25
|
+
| Paragraphs | `w:p`, `w:pPr`, `w:r`, `w:rPr`, `w:t` |
|
|
26
|
+
| Tables | `w:tbl`, `w:tblPr`, `w:tblGrid`, `w:tr`, `w:tc` |
|
|
27
|
+
| Styles | `w:styles`, `w:style`, `w:docDefaults` |
|
|
28
|
+
| Lists | `w:numbering`, `w:abstractNum`, `w:num` |
|
|
29
|
+
| Headers/Footers | `w:hdr`, `w:ftr` |
|
|
30
|
+
| Track Changes | `w:ins`, `w:del`, `w:rPrChange`, `w:pPrChange` |
|
|
31
|
+
| Comments | `w:comment`, `w:commentRangeStart`, `w:commentRangeEnd` |
|
|
32
|
+
|
|
33
|
+
### What It Does NOT Cover
|
|
34
|
+
|
|
35
|
+
- DrawingML elements (`a:`, `pic:`, `wp:`) — image/shape internals
|
|
36
|
+
- VML elements (`v:`, `o:`) — legacy shapes
|
|
37
|
+
- Math elements (`m:`) — equations
|
|
38
|
+
- Extended namespaces (`w14`, `w15`, `w16*`) — vendor extensions
|
|
39
|
+
- Custom XML data parts
|
|
40
|
+
- Relationship and content type validation (structural, not schema-based)
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Interpreting Errors
|
|
45
|
+
|
|
46
|
+
### Element Ordering Error
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
ERROR: Element 'w:jc' is not expected at this position.
|
|
50
|
+
Expected: w:spacing, w:ind, w:contextualSpacing, ...
|
|
51
|
+
Location: /word/document.xml, line 45
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Cause**: Child elements are in wrong order. See `references/openxml_element_order.md`.
|
|
55
|
+
**Fix**: Reorder children to match schema sequence.
|
|
56
|
+
|
|
57
|
+
### Missing Required Element
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
ERROR: Element 'w:tbl' missing required child 'w:tblPr'.
|
|
61
|
+
Location: /word/document.xml, line 102
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Cause**: A required child element is absent.
|
|
65
|
+
**Fix**: Add the missing element. Tables require both `w:tblPr` and `w:tblGrid`.
|
|
66
|
+
|
|
67
|
+
### Invalid Attribute Value
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
ERROR: Attribute 'w:val' has invalid value 'middle'.
|
|
71
|
+
Expected: 'left', 'center', 'right', 'both', 'distribute'
|
|
72
|
+
Location: /word/document.xml, line 78
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Cause**: An attribute value is not in the allowed enumeration.
|
|
76
|
+
**Fix**: Use one of the valid values listed in the error.
|
|
77
|
+
|
|
78
|
+
### Unexpected Element
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
ERROR: Element 'w:customTag' is not expected.
|
|
82
|
+
Location: /word/document.xml, line 200
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Cause**: An element not defined in the subset schema. May be a vendor extension.
|
|
86
|
+
**Fix**: Check if it's a known extension (w14/w15/w16). If so, it's likely safe. If unknown, investigate or remove.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Business Rules XSD
|
|
91
|
+
|
|
92
|
+
The `business-rules.xsd` schema enforces project-specific constraints beyond standard OpenXML validity:
|
|
93
|
+
|
|
94
|
+
| Rule | What It Checks |
|
|
95
|
+
|------|---------------|
|
|
96
|
+
| Required styles | `Normal`, `Heading1`-`Heading3`, `TableGrid` must exist in `styles.xml` |
|
|
97
|
+
| Font consistency | `w:docDefaults` fonts match expected values |
|
|
98
|
+
| Margin ranges | Page margins within acceptable range (720-2160 DXA) |
|
|
99
|
+
| Page size | Must be A4 or Letter |
|
|
100
|
+
| Heading hierarchy | No gaps (e.g., H1 → H3 without H2) |
|
|
101
|
+
| Style chain | `w:basedOn` references must resolve to existing styles |
|
|
102
|
+
|
|
103
|
+
### Extending Business Rules
|
|
104
|
+
|
|
105
|
+
To add project-specific rules, add `xs:assert` or `xs:restriction` elements:
|
|
106
|
+
|
|
107
|
+
```xml
|
|
108
|
+
<!-- Require minimum 1-inch margins -->
|
|
109
|
+
<xs:element name="pgMar">
|
|
110
|
+
<xs:complexType>
|
|
111
|
+
<xs:attribute name="top" type="xs:integer">
|
|
112
|
+
<xs:restriction>
|
|
113
|
+
<xs:minInclusive value="1440" />
|
|
114
|
+
</xs:restriction>
|
|
115
|
+
</xs:attribute>
|
|
116
|
+
</xs:complexType>
|
|
117
|
+
</xs:element>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Gate-Check: Scenario C Hard Gate
|
|
123
|
+
|
|
124
|
+
In Scenario C (Apply Template), the output document **MUST** pass `business-rules.xsd` validation before delivery:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
1. Apply template → output.docx
|
|
128
|
+
2. Validate → dotnet run ... validate output.docx --xsd business-rules.xsd
|
|
129
|
+
3. PASS? → Deliver to user
|
|
130
|
+
4. FAIL? → Fix issues, re-validate, repeat until PASS
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**This is a hard gate.** A document that fails business-rules validation is NOT deliverable, even if it opens correctly in Word.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## False Positives
|
|
138
|
+
|
|
139
|
+
### Vendor Extensions
|
|
140
|
+
|
|
141
|
+
Elements from extended namespaces (`w14`, `w15`, `w16*`) are not in the subset schema and may trigger warnings:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
WARNING: Element '{http://schemas.microsoft.com/office/word/2010/wordml}shadow' is not expected.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
These are generally safe to ignore — they are Microsoft extensions for newer features (e.g., advanced text effects, comment extensions).
|
|
148
|
+
|
|
149
|
+
### Markup Compatibility
|
|
150
|
+
|
|
151
|
+
Documents may contain `mc:AlternateContent` blocks with fallback content. The subset schema may not recognize the `mc:` namespace processing. These are safe if the document opens correctly in Word.
|
|
152
|
+
|
|
153
|
+
### Recommended Approach
|
|
154
|
+
|
|
155
|
+
1. Run validation
|
|
156
|
+
2. Treat **errors** as must-fix
|
|
157
|
+
3. Review **warnings** — ignore known vendor extensions, investigate unknown elements
|
|
158
|
+
4. After fixing errors, re-validate to confirm
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
echo "Usage: $(basename "$0") <file.doc> [output_directory]"
|
|
6
|
+
echo "Convert .doc to .docx using LibreOffice."
|
|
7
|
+
exit 1
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if [ $# -lt 1 ]; then
|
|
11
|
+
usage
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
INPUT="$1"
|
|
15
|
+
OUTDIR="${2:-.}"
|
|
16
|
+
|
|
17
|
+
if [ ! -f "$INPUT" ]; then
|
|
18
|
+
echo "Error: File not found: $INPUT"
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
if ! command -v soffice &>/dev/null; then
|
|
23
|
+
echo "Error: soffice (LibreOffice) is required for .doc conversion but not found."
|
|
24
|
+
echo "Install LibreOffice: brew install --cask libreoffice"
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
BASENAME=$(basename "$INPUT" .doc)
|
|
29
|
+
mkdir -p "$OUTDIR"
|
|
30
|
+
|
|
31
|
+
echo "Converting: $INPUT -> $OUTDIR/$BASENAME.docx"
|
|
32
|
+
soffice --headless --convert-to docx --outdir "$OUTDIR" "$INPUT" >/dev/null 2>&1
|
|
33
|
+
|
|
34
|
+
OUTPUT="$OUTDIR/$BASENAME.docx"
|
|
35
|
+
if [ ! -f "$OUTPUT" ]; then
|
|
36
|
+
echo "Error: Conversion failed. Output file not created: $OUTPUT"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
echo "Success: $OUTPUT"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
echo "Usage: $(basename "$0") <file.docx>"
|
|
6
|
+
echo "Preview DOCX content as plain text."
|
|
7
|
+
exit 1
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if [ $# -lt 1 ]; then
|
|
11
|
+
usage
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
INPUT="$1"
|
|
15
|
+
|
|
16
|
+
if [ ! -f "$INPUT" ]; then
|
|
17
|
+
echo "Error: File not found: $INPUT"
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
FILE_SIZE=$(du -h "$INPUT" | cut -f1)
|
|
22
|
+
echo "=== DOCX Preview: $(basename "$INPUT") ==="
|
|
23
|
+
echo "File size: $FILE_SIZE"
|
|
24
|
+
|
|
25
|
+
if command -v pandoc &>/dev/null; then
|
|
26
|
+
CONTENT=$(pandoc -f docx -t plain "$INPUT" 2>/dev/null)
|
|
27
|
+
WORD_COUNT=$(echo "$CONTENT" | wc -w | tr -d ' ')
|
|
28
|
+
EST_PAGES=$(( (WORD_COUNT + 249) / 250 ))
|
|
29
|
+
echo "Word count: $WORD_COUNT"
|
|
30
|
+
echo "Estimated pages: $EST_PAGES"
|
|
31
|
+
echo "---"
|
|
32
|
+
echo "$CONTENT"
|
|
33
|
+
else
|
|
34
|
+
echo "(pandoc not available, falling back to raw XML extract)"
|
|
35
|
+
echo "---"
|
|
36
|
+
unzip -p "$INPUT" word/document.xml 2>/dev/null | head -100
|
|
37
|
+
fi
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
2
|
+
|
|
3
|
+
<ItemGroup>
|
|
4
|
+
<ProjectReference Include="..\MiniMaxAIDocx.Core\MiniMaxAIDocx.Core.csproj" />
|
|
5
|
+
</ItemGroup>
|
|
6
|
+
|
|
7
|
+
<ItemGroup>
|
|
8
|
+
<PackageReference Include="System.CommandLine" Version="2.0.5" />
|
|
9
|
+
</ItemGroup>
|
|
10
|
+
|
|
11
|
+
<PropertyGroup>
|
|
12
|
+
<OutputType>Exe</OutputType>
|
|
13
|
+
<TargetFramework>net8.0</TargetFramework>
|
|
14
|
+
<ImplicitUsings>enable</ImplicitUsings>
|
|
15
|
+
<Nullable>enable</Nullable>
|
|
16
|
+
<NeutralLanguage>en</NeutralLanguage>
|
|
17
|
+
</PropertyGroup>
|
|
18
|
+
|
|
19
|
+
</Project>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
using System.CommandLine;
|
|
2
|
+
using MiniMaxAIDocx.Core.Commands;
|
|
3
|
+
|
|
4
|
+
var rootCommand = new RootCommand("minimax-docx: OpenXML document generation and manipulation CLI");
|
|
5
|
+
|
|
6
|
+
// Scenario commands
|
|
7
|
+
rootCommand.Add(CreateCommand.Create());
|
|
8
|
+
rootCommand.Add(EditContentCommand.Create());
|
|
9
|
+
rootCommand.Add(ApplyTemplateCommand.Create());
|
|
10
|
+
|
|
11
|
+
// Tool commands
|
|
12
|
+
rootCommand.Add(ValidateCommand.Create());
|
|
13
|
+
rootCommand.Add(MergeRunsCommand.Create());
|
|
14
|
+
rootCommand.Add(FixOrderCommand.Create());
|
|
15
|
+
rootCommand.Add(AnalyzeCommand.Create());
|
|
16
|
+
rootCommand.Add(DiffCommand.Create());
|
|
17
|
+
|
|
18
|
+
return rootCommand.Parse(args).Invoke();
|