dimcode-darwin-x64 0.1.2-beta.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/bin/dimcode +0 -0
  2. package/package.json +1 -1
  3. package/bin/runtime/sandbox/dim-sandbox-runner +0 -0
  4. package/bin/runtime/sandbox/manifest.json +0 -15
  5. package/bin/skills-assets/deep-investigate/SKILL.md +0 -101
  6. package/bin/skills-assets/deep-investigate/references/prompts.md +0 -75
  7. package/bin/skills-assets/deep-investigate/references/templates.md +0 -73
  8. package/bin/skills-assets/deep-investigate/references/thinking-tools.md +0 -36
  9. package/bin/skills-assets/docs-sprint/SKILL.md +0 -73
  10. package/bin/skills-assets/docs-sprint/agents/openai.yaml +0 -4
  11. package/bin/skills-assets/docs-sprint/references/contract-discipline.md +0 -30
  12. package/bin/skills-assets/docs-sprint/references/delivery-plan.md +0 -162
  13. package/bin/skills-assets/docs-sprint/references/documentation-system.md +0 -109
  14. package/bin/skills-assets/docs-sprint/references/ui-layout.md +0 -73
  15. package/bin/skills-assets/docs-sprint/references/worktree-guide.md +0 -45
  16. package/bin/skills-assets/docx/SKILL.md +0 -273
  17. package/bin/skills-assets/docx/assets/styles/academic_styles.xml +0 -250
  18. package/bin/skills-assets/docx/assets/styles/corporate_styles.xml +0 -284
  19. package/bin/skills-assets/docx/assets/styles/default_styles.xml +0 -449
  20. package/bin/skills-assets/docx/assets/xsd/aesthetic-rules.xsd +0 -470
  21. package/bin/skills-assets/docx/assets/xsd/business-rules.xsd +0 -130
  22. package/bin/skills-assets/docx/assets/xsd/common-types.xsd +0 -159
  23. package/bin/skills-assets/docx/assets/xsd/wml-subset.xsd +0 -589
  24. package/bin/skills-assets/docx/references/cjk_typography.md +0 -357
  25. package/bin/skills-assets/docx/references/cjk_university_template_guide.md +0 -184
  26. package/bin/skills-assets/docx/references/comments_guide.md +0 -191
  27. package/bin/skills-assets/docx/references/design_good_bad_examples.md +0 -829
  28. package/bin/skills-assets/docx/references/design_principles.md +0 -819
  29. package/bin/skills-assets/docx/references/openxml_element_order.md +0 -308
  30. package/bin/skills-assets/docx/references/openxml_encyclopedia_part1.md +0 -4061
  31. package/bin/skills-assets/docx/references/openxml_encyclopedia_part2.md +0 -2820
  32. package/bin/skills-assets/docx/references/openxml_encyclopedia_part3.md +0 -3381
  33. package/bin/skills-assets/docx/references/openxml_namespaces.md +0 -82
  34. package/bin/skills-assets/docx/references/openxml_units.md +0 -72
  35. package/bin/skills-assets/docx/references/scenario_a_create.md +0 -284
  36. package/bin/skills-assets/docx/references/scenario_b_edit_content.md +0 -295
  37. package/bin/skills-assets/docx/references/scenario_c_apply_template.md +0 -456
  38. package/bin/skills-assets/docx/references/track_changes_guide.md +0 -200
  39. package/bin/skills-assets/docx/references/troubleshooting.md +0 -506
  40. package/bin/skills-assets/docx/references/typography_guide.md +0 -294
  41. package/bin/skills-assets/docx/references/xsd_validation_guide.md +0 -158
  42. package/bin/skills-assets/docx/scripts/doc_to_docx.sh +0 -40
  43. package/bin/skills-assets/docx/scripts/docx_preview.sh +0 -37
  44. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Docx.Cli.csproj +0 -19
  45. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Program.cs +0 -18
  46. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/AnalyzeCommand.cs +0 -147
  47. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ApplyTemplateCommand.cs +0 -322
  48. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/CreateCommand.cs +0 -324
  49. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/DiffCommand.cs +0 -155
  50. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/EditContentCommand.cs +0 -487
  51. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/FixOrderCommand.cs +0 -108
  52. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/MergeRunsCommand.cs +0 -122
  53. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ValidateCommand.cs +0 -107
  54. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Docx.Core.csproj +0 -15
  55. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/CommentSynchronizer.cs +0 -169
  56. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/ElementOrder.cs +0 -80
  57. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/NamespaceConstants.cs +0 -42
  58. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/RunMerger.cs +0 -81
  59. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/StyleAnalyzer.cs +0 -81
  60. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/TrackChangesHelper.cs +0 -99
  61. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/UnitConverter.cs +0 -23
  62. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples.cs +0 -1832
  63. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch1.cs +0 -910
  64. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch2.cs +0 -999
  65. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch3.cs +0 -1048
  66. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch4.cs +0 -1038
  67. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/CharacterFormattingSamples.cs +0 -1020
  68. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/DocumentCreationSamples.cs +0 -1121
  69. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FieldAndTocSamples.cs +0 -624
  70. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FootnoteAndCommentSamples.cs +0 -675
  71. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/HeaderFooterSamples.cs +0 -838
  72. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ImageSamples.cs +0 -917
  73. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ListAndNumberingSamples.cs +0 -826
  74. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ParagraphFormattingSamples.cs +0 -1199
  75. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/StyleSystemSamples.cs +0 -1487
  76. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TableSamples.cs +0 -1163
  77. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TrackChangesSamples.cs +0 -595
  78. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/CjkHelper.cs +0 -39
  79. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/FontDefaults.cs +0 -24
  80. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/PageSizes.cs +0 -20
  81. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/BusinessRuleValidator.cs +0 -224
  82. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/GateCheckValidator.cs +0 -148
  83. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/ValidationResult.cs +0 -23
  84. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/XsdValidator.cs +0 -69
  85. package/bin/skills-assets/docx/scripts/dotnet/Docx.slnx +0 -4
  86. package/bin/skills-assets/docx/scripts/env_check.sh +0 -196
  87. package/bin/skills-assets/docx/scripts/setup.ps1 +0 -274
  88. package/bin/skills-assets/docx/scripts/setup.sh +0 -504
  89. package/bin/skills-assets/pdf/README.md +0 -222
  90. package/bin/skills-assets/pdf/SKILL.md +0 -191
  91. package/bin/skills-assets/pdf/design/design.md +0 -381
  92. package/bin/skills-assets/pdf/scripts/cover.py +0 -1579
  93. package/bin/skills-assets/pdf/scripts/fill_inspect.py +0 -200
  94. package/bin/skills-assets/pdf/scripts/fill_write.py +0 -242
  95. package/bin/skills-assets/pdf/scripts/make.sh +0 -491
  96. package/bin/skills-assets/pdf/scripts/merge.py +0 -112
  97. package/bin/skills-assets/pdf/scripts/palette.py +0 -521
  98. package/bin/skills-assets/pdf/scripts/reformat_parse.py +0 -374
  99. package/bin/skills-assets/pdf/scripts/render_body.py +0 -1052
  100. package/bin/skills-assets/pdf/scripts/render_cover.js +0 -111
  101. package/bin/skills-assets/pptx-generator/SKILL.md +0 -248
  102. package/bin/skills-assets/pptx-generator/references/design-system.md +0 -392
  103. package/bin/skills-assets/pptx-generator/references/editing.md +0 -162
  104. package/bin/skills-assets/pptx-generator/references/pitfalls.md +0 -112
  105. package/bin/skills-assets/pptx-generator/references/pptxgenjs.md +0 -420
  106. package/bin/skills-assets/pptx-generator/references/slide-types.md +0 -413
  107. package/bin/skills-assets/skill-creator/SKILL.md +0 -368
  108. package/bin/skills-assets/skill-creator/agents/openai.yaml +0 -5
  109. package/bin/skills-assets/skill-creator/assets/skill-creator-small.svg +0 -3
  110. package/bin/skills-assets/skill-creator/assets/skill-creator.png +0 -0
  111. package/bin/skills-assets/skill-creator/license.txt +0 -202
  112. package/bin/skills-assets/skill-creator/references/openai_yaml.md +0 -49
  113. package/bin/skills-assets/skill-creator/scripts/generate_openai_yaml.py +0 -226
  114. package/bin/skills-assets/skill-creator/scripts/init_skill.py +0 -397
  115. package/bin/skills-assets/skill-creator/scripts/quick_validate.py +0 -101
  116. package/bin/skills-assets/skill-installer/LICENSE.txt +0 -202
  117. package/bin/skills-assets/skill-installer/SKILL.md +0 -58
  118. package/bin/skills-assets/skill-installer/agents/openai.yaml +0 -5
  119. package/bin/skills-assets/skill-installer/assets/skill-installer-small.svg +0 -3
  120. package/bin/skills-assets/skill-installer/assets/skill-installer.png +0 -0
  121. package/bin/skills-assets/skill-installer/scripts/github_utils.py +0 -21
  122. package/bin/skills-assets/skill-installer/scripts/install-skill-from-github.py +0 -308
  123. package/bin/skills-assets/skill-installer/scripts/list-skills.py +0 -107
  124. package/bin/skills-assets/xlsx/SKILL.md +0 -137
  125. package/bin/skills-assets/xlsx/references/create.md +0 -691
  126. package/bin/skills-assets/xlsx/references/edit.md +0 -684
  127. package/bin/skills-assets/xlsx/references/fix.md +0 -37
  128. package/bin/skills-assets/xlsx/references/format.md +0 -768
  129. package/bin/skills-assets/xlsx/references/ooxml-cheatsheet.md +0 -231
  130. package/bin/skills-assets/xlsx/references/read-analyze.md +0 -97
  131. package/bin/skills-assets/xlsx/references/validate.md +0 -772
  132. package/bin/skills-assets/xlsx/scripts/formula_check.py +0 -422
  133. package/bin/skills-assets/xlsx/scripts/libreoffice_recalc.py +0 -248
  134. package/bin/skills-assets/xlsx/scripts/shared_strings_builder.py +0 -163
  135. package/bin/skills-assets/xlsx/scripts/style_audit.py +0 -575
  136. package/bin/skills-assets/xlsx/scripts/xlsx_add_column.py +0 -395
  137. package/bin/skills-assets/xlsx/scripts/xlsx_insert_row.py +0 -274
  138. package/bin/skills-assets/xlsx/scripts/xlsx_pack.py +0 -87
  139. package/bin/skills-assets/xlsx/scripts/xlsx_reader.py +0 -362
  140. package/bin/skills-assets/xlsx/scripts/xlsx_shift_rows.py +0 -396
  141. package/bin/skills-assets/xlsx/scripts/xlsx_unpack.py +0 -130
  142. package/bin/skills-assets/xlsx/templates/minimal_xlsx/[Content_Types].xml +0 -9
  143. package/bin/skills-assets/xlsx/templates/minimal_xlsx/_rels/.rels +0 -6
  144. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +0 -19
  145. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +0 -33
  146. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/styles.xml +0 -160
  147. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/workbook.xml +0 -30
  148. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +0 -70
@@ -1,294 +0,0 @@
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 | |
@@ -1,158 +0,0 @@
1
- # XSD Validation Guide
2
-
3
- ## Running Validation
4
-
5
- ```bash
6
- # Validate against the WML subset schema
7
- dotnet run --project 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 docx validate input.docx --xsd assets/xsd/business-rules.xsd
11
-
12
- # Validate against both
13
- dotnet run --project 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
@@ -1,40 +0,0 @@
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"
@@ -1,37 +0,0 @@
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
@@ -1,19 +0,0 @@
1
- <Project Sdk="Microsoft.NET.Sdk">
2
-
3
- <ItemGroup>
4
- <ProjectReference Include="..\Docx.Core\Docx.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>
@@ -1,18 +0,0 @@
1
- using System.CommandLine;
2
- using Docx.Core.Commands;
3
-
4
- var rootCommand = new RootCommand("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();