@bytechain.cn/colamd-themes 0.3.2 → 0.5.1
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/.claude/skills/colamd-themes-preview.skill.md +333 -0
- package/.claude/skills/colamd-themes.skill.md +10 -0
- package/.dsh/skills/colamd-themes/SKILL.md +14 -0
- package/.github/supported-topics.yml +17 -0
- package/.hermes/skills/tools/colamd-themes/SKILL.md +14 -0
- package/.openclaw/skills/colamd-themes/SKILL.md +1 -37
- package/.opencode/skills/colamd-themes/SKILL.md +17 -0
- package/.trae/rules/colamd-themes.md +0 -36
- package/CHANGELOG.md +331 -241
- package/DSH_SUPPORT_SUMMARY.md +87 -0
- package/README.md +414 -384
- package/README_CN.md +412 -384
- package/RELEASENOTE.md +541 -389
- package/dist/cli.js +36 -55
- package/dist/cli.js.map +1 -1
- package/dist/color-utils.d.ts +1 -0
- package/dist/color-utils.js +25 -6
- package/dist/color-utils.js.map +1 -1
- package/dist/extractors/pdf-extractor.js +6 -1
- package/dist/extractors/pdf-extractor.js.map +1 -1
- package/dist/extractors/url-extractor.d.ts +0 -4
- package/dist/extractors/url-extractor.js +13 -126
- package/dist/extractors/url-extractor.js.map +1 -1
- package/dist/generator.d.ts +1 -1
- package/dist/generator.js +32 -11
- package/dist/generator.js.map +1 -1
- package/dist/models.d.ts +5 -4
- package/dist/models.js +2 -3
- package/dist/models.js.map +1 -1
- package/dist/renderer.d.ts +6 -3
- package/dist/renderer.js +54 -93
- package/dist/renderer.js.map +1 -1
- package/dist/templates/template.css +220 -498
- package/dist/templates/theme-paradigm.md +530 -658
- package/dist/templates/theme-template.hbs +256 -370
- package/dist/theme-store.js +19 -3
- package/dist/theme-store.js.map +1 -1
- package/dist/utils/document-paradigm.d.ts +12 -0
- package/dist/utils/document-paradigm.js +109 -0
- package/dist/utils/document-paradigm.js.map +1 -0
- package/dist/validators.d.ts +4 -1
- package/dist/validators.js +115 -1
- package/dist/validators.js.map +1 -1
- package/mcp-server/dist/index.d.ts +13 -0
- package/mcp-server/dist/index.d.ts.map +1 -0
- package/mcp-server/dist/index.js +0 -0
- package/mcp-server/dist/index.js.map +1 -0
- package/mcp-server/package-lock.json +1759 -0
- package/mcp-server/package.json +24 -0
- package/mcp-server/src/index.ts +0 -0
- package/mcp-server/tsconfig.json +19 -0
- package/package.json +54 -36
- package/skills/build-skills.sh +30 -5
- package/skills/colamd-themes/SKILL.md +180 -178
- package/src/cli.ts +474 -487
- package/src/color-systems.ts +289 -289
- package/src/color-utils.ts +137 -120
- package/src/contrast.ts +66 -66
- package/src/docx-style-paradigm.ts +811 -811
- package/src/export-cli.ts +356 -356
- package/src/extractors/base.ts +8 -8
- package/src/extractors/docx-extractor.ts +417 -417
- package/src/extractors/pdf-extractor.ts +533 -527
- package/src/extractors/url-extractor.ts +846 -981
- package/src/generator.ts +197 -169
- package/src/index.ts +29 -29
- package/src/models.ts +212 -212
- package/src/renderer.ts +310 -359
- package/src/templates/template.css +220 -498
- package/src/templates/theme-paradigm.md +530 -658
- package/src/templates/theme-template.hbs +256 -370
- package/src/theme-store.ts +185 -170
- package/src/types/pdf-parse.d.ts +12 -12
- package/src/utils/cli-utils.ts +84 -84
- package/src/utils/document-paradigm.ts +118 -0
- package/src/validators.ts +298 -176
- package/themes/academic-paper-pt.css +353 -1805
- package/themes/academic-paper.css +350 -1099
- package/themes/academic-style.css +342 -2430
- package/themes/colly.css +256 -370
- package/themes/elegant.css +288 -671
- package/themes/forest-ink.css +240 -664
- package/themes/guizang.css +250 -732
- package/themes/hermes-security.css +279 -0
- package/themes/meeting-minutes.css +256 -370
- package/themes/pixso-design.css +278 -1261
- package/themes/salvator-blog.css +256 -370
- package/themes/shimo-theme.css +256 -0
- package/themes/swiss-design.css +285 -746
- package/themes/template.css +220 -498
- package/themes/trae-blue.css +280 -737
- package/themes/word-contract.css +249 -0
- package/themes-preview/demo-content.md +187 -187
- package/tsconfig.json +18 -18
- package/src/mermaid-presets.ts +0 -142
- package/themes/swiss-design copy.css +0 -746
- package/themes-preview/colly-preview.html +0 -623
- package/themes-preview/meeting-minutes-preview.html +0 -625
- package/themes-preview/salvator-blog-preview.html +0 -623
package/RELEASENOTE.md
CHANGED
|
@@ -1,389 +1,541 @@
|
|
|
1
|
-
# Release Notes
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
###
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
**
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
- **
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
|
127
|
-
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
1
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
**
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
**
|
|
224
|
-
-
|
|
225
|
-
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
**
|
|
231
|
-
-
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
**
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
- **
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
- **
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
**
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
**
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
**
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
**
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
#
|
|
332
|
-
cthemes
|
|
333
|
-
|
|
334
|
-
#
|
|
335
|
-
cthemes
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
-
|
|
384
|
-
-
|
|
385
|
-
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
1
|
+
# Release Notes
|
|
2
|
+
## Version 0.5.0 (2026-10-25) — ColaMD 2.7.7 Support 🎨
|
|
3
|
+
|
|
4
|
+
> **Verified against the published `@bytechain.cn/colamd@2.7.7` npm package**: all 16 themes are fully contract-compatible, and the design quality of 10 themes has been brought to zero paradigm errors.
|
|
5
|
+
|
|
6
|
+
### 🎨 Theme Quality Overhaul
|
|
7
|
+
|
|
8
|
+
**10 themes optimized to pass every paradigm rule (0 errors):**
|
|
9
|
+
|
|
10
|
+
| Theme | Fix |
|
|
11
|
+
|-------|-----|
|
|
12
|
+
| `colly` / `salvator-blog` / `meeting-minutes` | Panel hierarchy inverted → `--seed-panel-alt` deepened for a proper 2-step contrast |
|
|
13
|
+
| `swiss-design` | Border vs panel-alt lightness gap widened to 3 steps |
|
|
14
|
+
| `shimo-theme` | Panels now neutral grey; accent saturation raised to 83% (`#2a6bf2`) |
|
|
15
|
+
| `elegant` | Brick accent saturation 55% → 70% (`#b0401f`); hardcoded rgba values synced |
|
|
16
|
+
| `guizang` | Beige panels moved to neutral warm grey (fixes NT-02 hue drift) |
|
|
17
|
+
| `pixso-design` | Accent saturation 56% → 76% (`#4f46e5`); 6 gradients/borders migrated from `#6366f1` |
|
|
18
|
+
| `trae-blue` | Accent saturation 70% → 85% (`#2563eb`); panels neutralized |
|
|
19
|
+
| `forest-ink` | Accent saturation raised (`#356b44`); text greys re-tinted onto the ink-green hue axis |
|
|
20
|
+
|
|
21
|
+
Intentional warnings kept: the low-saturation scholarly accents of the academic trio, and meeting-minutes' pure-black accent (Swiss-minimal signature).
|
|
22
|
+
|
|
23
|
+
**Removed**: the legacy pre-2.7 theme (`body.theme-custom` root block, 58 dead variables, mojibake filename) — it had no effect under 2.7.7.
|
|
24
|
+
|
|
25
|
+
### ✅ 2.7.7 Compatibility Audit
|
|
26
|
+
|
|
27
|
+
Audited against the actual published npm package (`@bytechain.cn/colamd@2.7.7`):
|
|
28
|
+
|
|
29
|
+
- **Class hooks**: zero drift — every `.cm-md-*` class used by our themes exists among the 49 hooks in the 2.7.7 renderer CSS
|
|
30
|
+
- **Live variables**: the 14 core + 4 typography variables and all 9 `--pele-*` overrides are consumed by 2.7.7
|
|
31
|
+
- **Injection**: the 2.7.7 app appends custom theme CSS to `document.head` (`applyTheme`), so `:root` declarations cascade correctly
|
|
32
|
+
- **Contract version references** across the CLI, validators, and generator unified to 2.7.7
|
|
33
|
+
|
|
34
|
+
### 🛡️ Export Pipeline Guard
|
|
35
|
+
|
|
36
|
+
The npm `@bytechain.cn/colamd@2.7.7` package is the **Electron app distribution** — it no longer ships `dist/lib/colamd-renderer.js`, the library entry our HTML/PDF export pipeline needs. The CLI therefore keeps `@bytechain.cn/colamd@^1.5.2`, and `renderer.ts` now detects a 2.x install and fails with a clear downgrade instruction instead of a generic "Cannot find renderer" error.
|
|
37
|
+
|
|
38
|
+
Two related export fixes verified by smoke test:
|
|
39
|
+
|
|
40
|
+
- **Built-in theme resolution** — `-t elegant` previously let the 1.5.x renderer apply its own pre-2.7 built-in palette (`#c44b2b`); it now loads our `themes/elegant.css` (2.7.7 contract) first. Registered custom themes and direct `.css` paths were already correct.
|
|
41
|
+
- **Body-variable bridge** — the 1.5.x base CSS declares theme variables on `body`, overriding `:root` inheritance; the pipeline mirrors the theme's `:root` declarations onto `body` at injection time. Theme files themselves remain `:root`-only per the 2.7.7 contract.
|
|
42
|
+
|
|
43
|
+
> Theme files need no changes for the 2.7.7 app — import them via **Theme > Import Theme** or drop them into `~/.colamd/themes/`.
|
|
44
|
+
> Note: the app now ships its own built-in `elegant` theme; if you import our `elegant.css` into the app, consider renaming the file (e.g. `elegant-brick.css`) to avoid a name clash.
|
|
45
|
+
|
|
46
|
+
### 🔧 Housekeeping
|
|
47
|
+
|
|
48
|
+
- Fixed `package-lock.json` root manifest drift (`^2.0.0` → `^1.5.2`, matching `package.json`)
|
|
49
|
+
- Version bumped to **0.5.0**
|
|
50
|
+
|
|
51
|
+
### 📦 Upgrade
|
|
52
|
+
|
|
53
|
+
No breaking changes. Pull and rebuild:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
git pull
|
|
57
|
+
npm install
|
|
58
|
+
npm run build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Version 0.4.0 (2026-08-17) — DeepSeek Harness Integration 🤖
|
|
65
|
+
|
|
66
|
+
> **Multi-agent ecosystem update**: added DeepSeek Harness skill support and formalized 6-agent coverage.
|
|
67
|
+
|
|
68
|
+
### 🤖 AI Agent Update
|
|
69
|
+
|
|
70
|
+
**DeepSeek Harness Skill Support**
|
|
71
|
+
- Added `.dsh/skills/colamd-themes/SKILL.md` for DeepSeek Harness integration
|
|
72
|
+
- Build script now supports `bash skills/build-skills.sh dsh` target
|
|
73
|
+
- Consolidated multi-agent documentation across Claude Code, OpenCode, OpenClaw, Hermes, Trae, and DeepSeek Harness
|
|
74
|
+
|
|
75
|
+
### 🛠️ Improvements
|
|
76
|
+
|
|
77
|
+
- Standardized agent skill frontmatter with agent-specific metadata and command prerequisites
|
|
78
|
+
- Extended verification scripts (`DSH_SUPPORT_SUMMARY.md`, `test-dsh-skill.sh`)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## Version 0.3.3 (2026-08-26) — MCP Server & AI Agent Integration 🤖
|
|
84
|
+
|
|
85
|
+
> **AI ecosystem integration**: ColaMD-themes now connects to AI coding assistants via MCP protocol.
|
|
86
|
+
> **Chinese theme names now fully supported** — no more ASCII-only restriction.
|
|
87
|
+
|
|
88
|
+
### ✨ New Features
|
|
89
|
+
|
|
90
|
+
**MCP Server (Model Context Protocol)**
|
|
91
|
+
- Full MCP server implementation in `mcp-server/` directory
|
|
92
|
+
- 14 tools covering theme extraction, export, validation, and management
|
|
93
|
+
- Works with Chatbox, Cursor, Claude Desktop, Continue, and all MCP-compatible clients
|
|
94
|
+
- Quick setup via `npm run mcp` or configure in your MCP client settings
|
|
95
|
+
|
|
96
|
+
**Multi-Agent Skill Definitions**
|
|
97
|
+
- Added skill files for 5 AI coding agents:
|
|
98
|
+
- Claude Code, OpenCode, OpenClaw, Hermes, Trae
|
|
99
|
+
- Auto-generated from `skills/colamd-themes/SKILL.md` via `build-skills.sh`
|
|
100
|
+
|
|
101
|
+
**Chinese Theme Name Support**
|
|
102
|
+
- Fixed CLI ASCII-only filter that stripped non-ASCII characters from theme names
|
|
103
|
+
- MCP server detects non-ASCII names and bypasses the filter using `-o` flag
|
|
104
|
+
- Tested with: `"我的主题"` -> `themes/我的主题.css` ✅
|
|
105
|
+
|
|
106
|
+
### 📦 Quick Start (MCP)
|
|
107
|
+
|
|
108
|
+
**Chatbox Configuration:**
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"mcpServers": {
|
|
112
|
+
"colamd-themes": {
|
|
113
|
+
"command": "node",
|
|
114
|
+
"args": ["D:/path/to/ColaMD-themes/mcp-server/dist/index.js"],
|
|
115
|
+
"cwd": "D:/path/to/ColaMD-themes"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Then in your chat:**
|
|
122
|
+
> "Extract a theme from https://example.com named 'My Theme'"
|
|
123
|
+
|
|
124
|
+
### 🛠️ MCP Tools Reference
|
|
125
|
+
|
|
126
|
+
| Category | Tool | Description |
|
|
127
|
+
|----------|------|-------------|
|
|
128
|
+
| Extraction | `extract_from_url` | Theme from web page |
|
|
129
|
+
| | `extract_from_docx` | Theme from Word doc |
|
|
130
|
+
| | `extract_from_pdf` | Theme from PDF |
|
|
131
|
+
| | `extract_auto` | Auto-detect source |
|
|
132
|
+
| Management | `list_themes` | List all themes |
|
|
133
|
+
| | `validate_theme` | Validate theme rules |
|
|
134
|
+
| | `check_fonts` | Check font availability |
|
|
135
|
+
| | `set_theme` | Register custom theme |
|
|
136
|
+
| Color | `list_color_systems` | 15 built-in palettes |
|
|
137
|
+
| | `list_mermaid_presets` | 3 Mermaid presets |
|
|
138
|
+
| Export | `export_html` | Markdown to HTML |
|
|
139
|
+
| | `export_pdf` | Markdown to PDF |
|
|
140
|
+
| | `export_batch` | Batch export |
|
|
141
|
+
|
|
142
|
+
### 🔧 Migration
|
|
143
|
+
|
|
144
|
+
**No breaking changes** — fully backward compatible.
|
|
145
|
+
|
|
146
|
+
**New scripts available:**
|
|
147
|
+
```bash
|
|
148
|
+
npm run build:mcp # Build MCP server only
|
|
149
|
+
npm run build:all # Build CLI + MCP server
|
|
150
|
+
npm run mcp # Start MCP server
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Version 0.3.2 (2026-05-29) — Theme Authoring Guide 📝
|
|
156
|
+
|
|
157
|
+
> **AI agent skill enhancement**: Added comprehensive CSS pitfall quick reference for reliable theme generation.
|
|
158
|
+
|
|
159
|
+
### 📝 AI Agent Skill Update
|
|
160
|
+
|
|
161
|
+
**CSS Pitfall Quick Reference**
|
|
162
|
+
- Added 6-topic theme authoring guide to all AI agent skill definitions:
|
|
163
|
+
1. **Screen & Print Sync** — every SECTION 5 rule must mirror in SECTION 6 `@media print`
|
|
164
|
+
2. **Body Text First-Line Indent** — correct selector chain: `body.theme-custom p, body.theme-custom #write > p`
|
|
165
|
+
3. **Indent Exclusion** — prevent indent pollution in lists, tables, mermaid blocks, blockquotes, and figures
|
|
166
|
+
4. **List Indentation** — use `margin-left: 2em` instead of `padding-left`; include `#editor .ProseMirror` selectors
|
|
167
|
+
5. **Mermaid CJK Text Overflow** — ≤ 2 lines per node, `fontSize: 14px`, simplified text
|
|
168
|
+
6. **Mermaid classDef Inheritance** — must explicitly declare `fill / color / stroke`
|
|
169
|
+
- References `academic-paper.css` and `swiss-design.css` as canonical examples
|
|
170
|
+
- Skill files affected: `.claude/skills/`, `.opencode/skills/`, `.openclaw/skills/`, `.hermes/skills/`, `.trae/rules/`, `.dsh/skills/colamd-themes/SKILL.md`
|
|
171
|
+
|
|
172
|
+
### 🔧 Changes
|
|
173
|
+
|
|
174
|
+
- Consolidated all unreleased changes from v0.3.1 into this patch release
|
|
175
|
+
- Updated CHANGELOG and version links for the 0.3.2 release
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Version 0.3.1 (2026-06-01) — Security & Stability Patch 🔒
|
|
180
|
+
|
|
181
|
+
> **Important**: This release contains critical security fixes and important stability improvements.
|
|
182
|
+
> **All users are strongly recommended to upgrade.**
|
|
183
|
+
|
|
184
|
+
### 🚨 Critical Security Fixes
|
|
185
|
+
|
|
186
|
+
**SSRF Vulnerability Patch (CVE-Level)**
|
|
187
|
+
- **Issue**: URL extractor was vulnerable to Server-Side Request Forgery attacks
|
|
188
|
+
- Attackers could force the server to access internal network resources
|
|
189
|
+
- Could expose sensitive internal services or cause denial-of-service
|
|
190
|
+
- **Fix**: Implemented comprehensive URL validation in [`url-extractor.ts`](src/extractors/url-extractor.ts):
|
|
191
|
+
- ✅ Protocol whitelist: Only `http:` and `https:` allowed
|
|
192
|
+
- ✅ Private network blocking: localhost, 10.x, 172.16-31.x, 192.168.x, 169.254.x
|
|
193
|
+
- ✅ Clear error messages for blocked attempts
|
|
194
|
+
- **Impact**: Prevents unauthorized internal network access; protects against SSRF attacks
|
|
195
|
+
|
|
196
|
+
**Input Validation Hardening**
|
|
197
|
+
- **Issue**: No validation on custom CSS theme files before processing
|
|
198
|
+
- Large files could cause memory exhaustion (OOM)
|
|
199
|
+
- Invalid file formats could crash the process
|
|
200
|
+
- **Fix**: Added multi-layer validation in [`theme-store.ts`](src/theme-store.ts):
|
|
201
|
+
- ✅ File extension check (must be `.css`)
|
|
202
|
+
- ✅ Size limit enforcement (1MB maximum)
|
|
203
|
+
- ✅ Content validity verification (minimum 10 characters)
|
|
204
|
+
- ✅ Sanitized filename extraction (removes special chars, limits length)
|
|
205
|
+
- **Impact**: Prevents OOM attacks; ensures graceful error handling
|
|
206
|
+
|
|
207
|
+
### 🐛 Major Bug Fixes
|
|
208
|
+
|
|
209
|
+
**PDF Export Theme Not Applied**
|
|
210
|
+
- **Symptom**: Custom themes were ignored when exporting to PDF; documents rendered with default styling only
|
|
211
|
+
- **Root Cause**: Puppeteer's `emulateMediaType("screen")` forced browser into screen mode, causing CSS `@media print { ... }` rules to be completely ignored
|
|
212
|
+
- **Fix**: Removed screen media type emulation in [`renderer.ts`](src/renderer.ts); allows default print mode where all `@media print` styles apply correctly
|
|
213
|
+
- **Result**: PDF exports now render with full theme fidelity — colors, fonts, backgrounds, spacing, and all visual styling correctly applied
|
|
214
|
+
|
|
215
|
+
**Puppeteer Resource Leak**
|
|
216
|
+
- **Symptom**: Zombie Chromium processes left running after export operations completed
|
|
217
|
+
- **Cause**: Page objects not explicitly closed before browser termination
|
|
218
|
+
- **Fix**: Explicit page cleanup in [`renderer.ts`](src/renderer.ts#L150-L155) close() method
|
|
219
|
+
- **Result**: Clean process shutdown; no resource leaks
|
|
220
|
+
|
|
221
|
+
**CLI Version Display Incorrect**
|
|
222
|
+
- **Symptom**: `colamd-themes --version` always showed "0.2.0" regardless of actual version
|
|
223
|
+
- **Cause**: Hardcoded version string in CLI initialization
|
|
224
|
+
- **Fix**: Dynamic version reading from [`package.json`](package.json) via [`getPackageVersion()`](src/cli.ts)
|
|
225
|
+
- **Result**: Accurate version display matching published package version
|
|
226
|
+
|
|
227
|
+
### ⚡ Performance Improvements
|
|
228
|
+
|
|
229
|
+
**Async I/O Migration**
|
|
230
|
+
- **Before**: Synchronous file operations (`readFileSync`, `writeFileSync`) blocked event loop during theme configuration
|
|
231
|
+
- **After**: All theme store operations now use async API (`fs/promises`)
|
|
232
|
+
- **Benefit**:
|
|
233
|
+
- Non-blocking configuration reads/writes
|
|
234
|
+
- Improved responsiveness during batch exports
|
|
235
|
+
- Better scalability for concurrent operations
|
|
236
|
+
- **Files Updated**: [`theme-store.ts`](src/theme-store.ts)
|
|
237
|
+
|
|
238
|
+
**Template Cache Management**
|
|
239
|
+
- **Before**: Single global template variable; recompiled on every call after first use; no size limits
|
|
240
|
+
- **After**: Sophisticated cache system with three-layer invalidation:
|
|
241
|
+
1. **LRU Eviction**: Maximum 10 cached templates (evicts oldest when full)
|
|
242
|
+
2. **TTL Expiration**: Automatic expiry after 30 minutes of inactivity
|
|
243
|
+
3. **mtime Detection**: Auto-invalidates when source template file is modified on disk
|
|
244
|
+
- **Benefit**:
|
|
245
|
+
- ~90% reduction in template compilations for repeated operations
|
|
246
|
+
- Stable memory usage in long-running processes
|
|
247
|
+
- Fresh templates automatically loaded after updates
|
|
248
|
+
- **Files Updated**: [`generator.ts`](src/generator.ts)
|
|
249
|
+
|
|
250
|
+
### 🛠️ Code Quality Enhancements
|
|
251
|
+
|
|
252
|
+
**Unified Error Handling System**
|
|
253
|
+
- **New Module**: [`cli-utils.ts`](src/utils/cli-utils.ts)
|
|
254
|
+
- **Features**:
|
|
255
|
+
- `CLIError` class: Structured errors with code, message, and cause chain
|
|
256
|
+
- `ErrorCode` enum: Standardized categories (FILE_NOT_FOUND, THEME_ERROR, RENDER_ERROR, INVALID_INPUT, UNKNOWN)
|
|
257
|
+
- Consistent error propagation across all commands
|
|
258
|
+
- **Impact**:
|
|
259
|
+
- Better debugging experience with detailed error context
|
|
260
|
+
- Consistent user-facing error messages
|
|
261
|
+
- Easier error tracking and logging
|
|
262
|
+
- Process exits with meaningful exit codes
|
|
263
|
+
|
|
264
|
+
**Code Deduplication**
|
|
265
|
+
- **Extracted Utilities**:
|
|
266
|
+
- `resolveInputPath(input)`: Validates existence, converts relative→absolute paths
|
|
267
|
+
- `resolveOutputPath(input, output?, ext?)`: Smart output path derivation
|
|
268
|
+
- `getDocumentTitle(filePath)`: Extracts clean document title from path
|
|
269
|
+
- **Impact**:
|
|
270
|
+
- Eliminated duplicate path resolution logic across 4+ command handlers
|
|
271
|
+
- Single source of truth reduces maintenance burden
|
|
272
|
+
- Consistent behavior across all export commands
|
|
273
|
+
|
|
274
|
+
### 📊 Metrics & Benchmarks
|
|
275
|
+
|
|
276
|
+
| Metric | v0.3.0 | v0.3.1 | Improvement |
|
|
277
|
+
|--------|--------|--------|-------------|
|
|
278
|
+
| **Security Vulnerabilities** | 2 Critical | 0 Known | ✅ Resolved |
|
|
279
|
+
| **Memory Usage (100 files)** | Unbounded | Stable | ✅ Predictable |
|
|
280
|
+
| **Template Compilations** | ~100 per batch | ~10 max | ⚡ 90% fewer |
|
|
281
|
+
| **Event Loop Blocking** | Frequent sync I/O | Minimal async ops | ⚡ Responsive |
|
|
282
|
+
| **Error Consistency** | Mixed patterns | Unified codes | ✅ Maintainable |
|
|
283
|
+
| **Zombie Processes** | Possible leak | Clean shutdown | ✅ Reliable |
|
|
284
|
+
|
|
285
|
+
### 🔧 Migration Guide
|
|
286
|
+
|
|
287
|
+
**For Most Users**: No action required! This is a drop-in replacement.
|
|
288
|
+
|
|
289
|
+
**Breaking Changes**: None — fully backward compatible.
|
|
290
|
+
|
|
291
|
+
**API Changes** (for programmatic usage):
|
|
292
|
+
```typescript
|
|
293
|
+
// Before (v0.3.0): Sync API
|
|
294
|
+
import { resolveTheme } from '@bytechain.cn/colamd-themes';
|
|
295
|
+
const theme = resolveTheme('elegant'); // Sync
|
|
296
|
+
|
|
297
|
+
// After (v0.3.1): Async API
|
|
298
|
+
import { resolveTheme } from '@bytechain.cn/colamd-themes';
|
|
299
|
+
const theme = await resolveTheme('elegant'); // Async
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**New Error Handling** (recommended):
|
|
303
|
+
```typescript
|
|
304
|
+
import { CLIError, ErrorCode } from '@bytechain.cn/colamd-themes';
|
|
305
|
+
|
|
306
|
+
try {
|
|
307
|
+
await exportHTML(document, { theme: 'custom' });
|
|
308
|
+
} catch (error) {
|
|
309
|
+
if (error instanceof CLIError) {
|
|
310
|
+
console.error(`Error ${error.code}: ${error.message}`);
|
|
311
|
+
// Handle specific error types
|
|
312
|
+
switch (error.code) {
|
|
313
|
+
case ErrorCode.FILE_NOT_FOUND: /* ... */ break;
|
|
314
|
+
case ErrorCode.THEME_ERROR: /* ... */ break;
|
|
315
|
+
case ErrorCode.RENDER_ERROR: /* ... */ break;
|
|
316
|
+
default: /* ... */ break;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### ✅ Testing Recommendations
|
|
323
|
+
|
|
324
|
+
After upgrading, verify these critical scenarios:
|
|
325
|
+
|
|
326
|
+
1. **Security Test**:
|
|
327
|
+
```bash
|
|
328
|
+
# Should be blocked (private network)
|
|
329
|
+
cthemes from-url "http://localhost:3000" --name test
|
|
330
|
+
|
|
331
|
+
# Should be blocked (invalid protocol)
|
|
332
|
+
cthemes from-url "ftp://example.com/file.css" --name test
|
|
333
|
+
|
|
334
|
+
# Should work (public HTTPS)
|
|
335
|
+
cthemes from-url "https://example.com" --name my-theme
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
2. **PDF Export Test**:
|
|
339
|
+
```bash
|
|
340
|
+
# Verify themes now apply correctly
|
|
341
|
+
cthemes export-pdf doc.md -t elegant -o test.pdf
|
|
342
|
+
open test.pdf # Check styling is applied
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
3. **Version Display Test**:
|
|
346
|
+
```bash
|
|
347
|
+
# Should show 0.3.1
|
|
348
|
+
cthemes --version
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
4. **Large File Protection Test**:
|
|
352
|
+
```bash
|
|
353
|
+
# Create a large CSS file (>1MB)
|
|
354
|
+
dd if=/dev/urandom of=large-theme.css bs=1024 count=1100
|
|
355
|
+
|
|
356
|
+
# Should fail gracefully
|
|
357
|
+
cthemes set-theme big --css large-theme.css
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### 📝 Full Changelog
|
|
361
|
+
|
|
362
|
+
For complete details on all changes, see [CHANGELOG.md](./CHANGELOG.md).
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## Version 0.3.0 (2026-06-01)
|
|
367
|
+
|
|
368
|
+
### 📦 Package Name Change
|
|
369
|
+
|
|
370
|
+
**Migrated to Scoped Package**
|
|
371
|
+
- Package name changed from `colamd-themes` to **`@bytechain.cn/colamd-themes`**
|
|
372
|
+
- Belongs to the `@bytechain.cn` organization ecosystem
|
|
373
|
+
- Consistent with dependency `@bytechain.cn/colamd`
|
|
374
|
+
|
|
375
|
+
**New Short CLI Command**
|
|
376
|
+
- Added `cthemes` as a short alias for `colamd-themes`
|
|
377
|
+
- Both commands are fully equivalent and interchangeable
|
|
378
|
+
- Recommended for frequent use: shorter to type, same functionality
|
|
379
|
+
|
|
380
|
+
### 🎨 New Themes
|
|
381
|
+
|
|
382
|
+
**Trae Blue Theme**
|
|
383
|
+
- Modern blue color scheme optimized for technical documentation
|
|
384
|
+
- Enhanced readability with carefully tuned contrast ratios
|
|
385
|
+
- Perfect for developer guides, API documentation, and code-heavy content
|
|
386
|
+
|
|
387
|
+
**Forest Ink Theme**
|
|
388
|
+
- Nature-inspired dark green palette with elegant ink aesthetics
|
|
389
|
+
- Sophisticated design suitable for long-form reading and literary content
|
|
390
|
+
- Unique visual identity that stands out from traditional themes
|
|
391
|
+
|
|
392
|
+
### ✨ Improvements
|
|
393
|
+
|
|
394
|
+
**Enhanced Swiss Design Theme**
|
|
395
|
+
- Refined typography with improved spacing and line heights
|
|
396
|
+
- Better color contrast for enhanced accessibility
|
|
397
|
+
- Polished overall visual appearance
|
|
398
|
+
|
|
399
|
+
**Better Developer Experience**
|
|
400
|
+
- **Absolute Path Support**: Use full file paths in all CLI commands — no more relative path confusion
|
|
401
|
+
```bash
|
|
402
|
+
cthemes export-html /full/path/to/document.md -t elegant -o output.html
|
|
403
|
+
```
|
|
404
|
+
- **Interactive Previews**: New HTML preview files for colly and salvator-blog themes
|
|
405
|
+
- **Build Process**: Fixed template file copying to ensure reliable distributions
|
|
406
|
+
|
|
407
|
+
### 🧹 Housekeeping
|
|
408
|
+
|
|
409
|
+
- Removed system files (`.DS_Store`) from repository
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Version 0.2.0 (2026-05-25)
|
|
414
|
+
|
|
415
|
+
### 🚀 Major Upgrade: v3.0 Design System
|
|
416
|
+
|
|
417
|
+
**Complete Paradigm Overhaul**
|
|
418
|
+
- Implemented ColaMD's new v3.0 seed palette architecture
|
|
419
|
+
- **15 predefined palettes** across 5 color families:
|
|
420
|
+
- Morandi (soft, muted tones)
|
|
421
|
+
- Macaron (pastel, playful)
|
|
422
|
+
- Nordic (cool, minimalist)
|
|
423
|
+
- Vintage (warm, retro)
|
|
424
|
+
- Mint (fresh, vibrant)
|
|
425
|
+
- **Auto-derived semantic mapping**: Design tokens automatically generate consistent color relationships
|
|
426
|
+
- **Mermaid Integration**: 3 diagram presets with 20 customizable variables
|
|
427
|
+
|
|
428
|
+
### 📚 Academic Focus
|
|
429
|
+
|
|
430
|
+
**New Academic Style Theme**
|
|
431
|
+
- Specialized formatting for research papers and scholarly documents
|
|
432
|
+
- Optimized typography for citations, references, and structured content
|
|
433
|
+
- Follows academic publishing conventions
|
|
434
|
+
|
|
435
|
+
**Redesigned Academic Paper Theme**
|
|
436
|
+
- Restructured to comply with v3.0 paradigm specifications
|
|
437
|
+
- Improved consistency with other themes in the ecosystem
|
|
438
|
+
|
|
439
|
+
### 🔧 Under the Hood
|
|
440
|
+
|
|
441
|
+
**Refactored Extractors**
|
|
442
|
+
- **URL Extractor**: Advanced CSS parsing with specificity-aware style resolution
|
|
443
|
+
- **DOCX Extractor**: Enhanced Word document style mapping via mammoth
|
|
444
|
+
- **PDF Extractor**: Multi-layer heuristic analysis for better metadata extraction
|
|
445
|
+
- **Auto-Detection**: Smarter source type identification
|
|
446
|
+
|
|
447
|
+
**Validation Engine**
|
|
448
|
+
- WCAG 2.1 compliance checking built-in
|
|
449
|
+
- 15+ design constraint rules with auto-fix suggestions
|
|
450
|
+
- Contrast ratio and luminance calculations
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## Version 0.1.0 (2026-05-22) — Initial Release 🎉
|
|
455
|
+
|
|
456
|
+
### Core Features
|
|
457
|
+
|
|
458
|
+
**Theme Extraction from Any Source**
|
|
459
|
+
- **Web Pages**: Fetch URLs and extract CSS styling automatically
|
|
460
|
+
- **Word Documents**: Import `.docx` files and preserve document styles
|
|
461
|
+
- **PDF Files**: Analyze PDF typography and generate matching themes
|
|
462
|
+
- **Smart Detection**: Automatically identifies source type
|
|
463
|
+
|
|
464
|
+
**Professional Export Capabilities**
|
|
465
|
+
- **HTML Export**: Standalone documents with embedded themes
|
|
466
|
+
- Full Mermaid diagram rendering
|
|
467
|
+
- KaTeX math formula support
|
|
468
|
+
- Responsive layout with print optimization
|
|
469
|
+
- **PDF Export**: High-quality PDF generation via Chromium
|
|
470
|
+
- Pixel-perfect theme reproduction
|
|
471
|
+
- Custom page formats (A4, Letter, etc.)
|
|
472
|
+
- Batch processing for multiple files
|
|
473
|
+
|
|
474
|
+
**Complete Theme Management**
|
|
475
|
+
- Built-in theme library (light, dark, elegant, newsprint)
|
|
476
|
+
- Custom theme registration from CSS files
|
|
477
|
+
- Default theme configuration
|
|
478
|
+
- Easy switching between themes
|
|
479
|
+
|
|
480
|
+
**Developer-Friendly CLI**
|
|
481
|
+
|
|
482
|
+
```bash
|
|
483
|
+
# Extract theme from any source (use `colamd-themes` or short alias `cthemes`)
|
|
484
|
+
cthemes extract source.docx --name my-theme
|
|
485
|
+
|
|
486
|
+
# Export with beautiful styling
|
|
487
|
+
cthemes export-html doc.md -t elegant -o output.html
|
|
488
|
+
cthemes export-pdf doc.md -t dark --format A4 -o output.pdf
|
|
489
|
+
|
|
490
|
+
# Batch process entire directories
|
|
491
|
+
cthemes export docs/ --format pdf -t elegant -d output/
|
|
492
|
+
|
|
493
|
+
# Manage your themes
|
|
494
|
+
cthemes list
|
|
495
|
+
cthemes validate themes/my-theme.css
|
|
496
|
+
cthemes set-theme my-brand --css custom.css --default
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### Technology Stack
|
|
500
|
+
|
|
501
|
+
- **TypeScript**: Type-safe implementation with full IDE support
|
|
502
|
+
- **css-tree**: Robust CSS parsing and analysis
|
|
503
|
+
- **mammoth**: Reliable DOCX processing
|
|
504
|
+
- **puppeteer**: Accurate PDF rendering
|
|
505
|
+
- **handlebars**: Flexible template engine
|
|
506
|
+
- **commander**: Intuitive CLI framework
|
|
507
|
+
|
|
508
|
+
### Perfect For
|
|
509
|
+
|
|
510
|
+
✅ Technical documentation teams needing consistent branding
|
|
511
|
+
✅ Content creators exporting Markdown to professional formats
|
|
512
|
+
✅ Developers building documentation pipelines
|
|
513
|
+
✅ Anyone wanting beautiful, themed Markdown output
|
|
514
|
+
|
|
515
|
+
---
|
|
516
|
+
|
|
517
|
+
## Quick Start
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
# Install
|
|
521
|
+
git clone https://github.com/byteuser1977/ColaMD-themes.git
|
|
522
|
+
cd ColaMD-themes
|
|
523
|
+
npm install
|
|
524
|
+
npm run build
|
|
525
|
+
|
|
526
|
+
# Try it out (use either command)
|
|
527
|
+
cthemes export-html README.md -t trae-blue -o preview.html
|
|
528
|
+
open preview.html
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
## Links
|
|
532
|
+
|
|
533
|
+
- **Documentation**: [README.md](./README.md)
|
|
534
|
+
- **Chinese Documentation**: [README_CN.md](./README_CN.md)
|
|
535
|
+
- **Changelog**: [CHANGELOG.md](./CHANGELOG.md)
|
|
536
|
+
- **Issues**: [GitHub Issues](https://github.com/byteuser1977/ColaMD-themes/issues)
|
|
537
|
+
- **Contributing**: Pull requests welcome!
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
*Last updated: 2026-10-25*
|