@bytechain.cn/colamd-themes 0.5.0 → 0.5.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 (71) hide show
  1. package/README.md +27 -13
  2. package/cordis.patch.yml +9 -0
  3. package/dist/cli.js +3 -3
  4. package/dist/cli.js.map +1 -1
  5. package/dist/dsh-plugin.d.ts +44 -0
  6. package/dist/dsh-plugin.js +72 -0
  7. package/dist/dsh-plugin.js.map +1 -0
  8. package/dist/generator.d.ts +1 -1
  9. package/dist/generator.js +2 -2
  10. package/dist/generator.js.map +1 -1
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +2 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/models.d.ts +1 -1
  15. package/dist/models.js +1 -1
  16. package/dist/models.js.map +1 -1
  17. package/dist/renderer.d.ts +6 -5
  18. package/dist/renderer.js +19 -38
  19. package/dist/renderer.js.map +1 -1
  20. package/dist/theme-store.js +4 -4
  21. package/dist/theme-store.js.map +1 -1
  22. package/dist/validators.d.ts +2 -2
  23. package/dist/validators.js +4 -4
  24. package/dist/validators.js.map +1 -1
  25. package/package.json +22 -2
  26. package/skills/build-skills.sh +5 -5
  27. package/skills/colamd-themes/SKILL.md +5 -5
  28. package/.claude/skills/colamd-themes-preview.skill.md +0 -333
  29. package/.claude/skills/colamd-themes.skill.md +0 -10
  30. package/.dsh/skills/colamd-themes/SKILL.md +0 -14
  31. package/.github/supported-topics.yml +0 -17
  32. package/.hermes/skills/tools/colamd-themes/SKILL.md +0 -14
  33. package/.openclaw/skills/colamd-themes/SKILL.md +0 -21
  34. package/.opencode/skills/colamd-themes/SKILL.md +0 -17
  35. package/.trae/rules/colamd-themes.md +0 -5
  36. package/CHANGELOG.md +0 -318
  37. package/DSH_SUPPORT_SUMMARY.md +0 -87
  38. package/README_CN.md +0 -412
  39. package/RELEASENOTE.md +0 -541
  40. package/bytechain.cn-colamd-themes-0.5.0.tgz +0 -0
  41. package/mcp-server/dist/index.d.ts +0 -13
  42. package/mcp-server/dist/index.d.ts.map +0 -1
  43. package/mcp-server/dist/index.js.map +0 -1
  44. package/mcp-server/package-lock.json +0 -1759
  45. package/mcp-server/package.json +0 -24
  46. package/mcp-server/src/index.ts +0 -0
  47. package/mcp-server/tsconfig.json +0 -19
  48. package/src/cli.ts +0 -474
  49. package/src/color-systems.ts +0 -289
  50. package/src/color-utils.ts +0 -137
  51. package/src/contrast.ts +0 -66
  52. package/src/docx-style-paradigm.ts +0 -811
  53. package/src/export-cli.ts +0 -356
  54. package/src/extractors/base.ts +0 -8
  55. package/src/extractors/docx-extractor.ts +0 -417
  56. package/src/extractors/pdf-extractor.ts +0 -533
  57. package/src/extractors/url-extractor.ts +0 -846
  58. package/src/generator.ts +0 -197
  59. package/src/index.ts +0 -29
  60. package/src/models.ts +0 -212
  61. package/src/renderer.ts +0 -332
  62. package/src/templates/template.css +0 -220
  63. package/src/templates/theme-paradigm.md +0 -530
  64. package/src/templates/theme-template.hbs +0 -256
  65. package/src/theme-store.ts +0 -185
  66. package/src/types/pdf-parse.d.ts +0 -12
  67. package/src/utils/cli-utils.ts +0 -84
  68. package/src/utils/document-paradigm.ts +0 -118
  69. package/src/validators.ts +0 -298
  70. package/themes-preview/demo-content.md +0 -187
  71. package/tsconfig.json +0 -18
@@ -1,333 +0,0 @@
1
- ---
2
- name: colamd-themes-preview
3
- description: >-
4
- Preview and showcase ColaMD themes with interactive HTML demos, batch
5
- comparisons, and development server. Use when user wants to visualize a
6
- theme's appearance across different Markdown elements or compare multiple
7
- themes side-by-side.
8
- ---
9
-
10
- # ColaMD Themes Preview — Visual Theme Showcase
11
-
12
- ## Overview
13
-
14
- This skill complements `colamd-themes` by adding visual preview capabilities:
15
-
16
- - **Static HTML preview** — Generate a standalone HTML file showcasing a theme
17
- - **Batch comparison** — Compare multiple themes in one page with synchronized scrolling
18
- - **Dev server** — Hot-reload preview server for theme development
19
- - **Demo content** — Includes comprehensive Markdown examples (headings, lists, tables, code blocks, Mermaid diagrams, math, etc.)
20
-
21
- ## When to Use
22
-
23
- - After generating a theme with `colamd-themes extract` → preview it before validation
24
- - When choosing between multiple extracted themes → batch compare
25
- - During theme fine-tuning → use dev server for instant feedback
26
- - Before sharing a theme → generate polished showcase page
27
-
28
- ## Prerequisites
29
-
30
- - Node.js ≥ 18
31
- - ColaMD-themes project at: `/Volumes/DATA/data/develop/git/ColaMD-themes`
32
- - Theme CSS files available in `themes/` directory
33
-
34
- ## Commands
35
-
36
- ### Generate Static Preview for a Single Theme
37
-
38
- ```bash
39
- colamd-themes-preview generate <theme.css> [options]
40
- # Output: themes-preview/<theme-name>-preview.html
41
- ```
42
-
43
- Options:
44
-
45
- | Flag | Description |
46
- |------|-------------|
47
- | `-c, --content <file.md>` | Custom Markdown content (default: built-in demo) |
48
- | `-o, --output <path>` | Output HTML file path |
49
- | `-t, --title <text>` | Page title |
50
- | `--embedded` | Embed theme CSS directly (single file) |
51
- | `--no-mermaid` | Skip Mermaid demo section |
52
-
53
- ### Batch Compare Multiple Themes
54
-
55
- ```bash
56
- colamd-themes-preview compare <theme1.css> <theme2.css> [theme3.css...] [options]
57
- # Output: themes-preview/comparison-<timestamp>.html
58
- ```
59
-
60
- Features:
61
- - Themes displayed in vertical tabs
62
- - Synchronized scroll position
63
- - Common content rendered under each theme
64
- - Visual diff indicators (color swatches)
65
-
66
- ### Start Development Preview Server
67
-
68
- ```bash
69
- colamd-themes-preview serve [options]
70
- # Serves at http://localhost:3000
71
- ```
72
-
73
- Options:
74
-
75
- | Flag | Description |
76
- |------|-------------|
77
- | `-p, --port <number>` | Server port (default: 3000) |
78
- | `-w, --watch <dir>` | Watch directory for CSS changes |
79
- | `-t, --themes-dir <dir>` | Themes directory (default: `themes/`) |
80
- | `--open` | Open browser automatically |
81
-
82
- Auto-reload: When a watched CSS file changes, the page refreshes automatically.
83
-
84
- ### Export Demo Content
85
-
86
- ```bash
87
- colamd-themes-preview export-demo <output.md>
88
- # Generates comprehensive Markdown with all element types
89
- ```
90
-
91
- ### Audit Theme against Document Type
92
-
93
- ```bash
94
- colamd-themes-preview audit <theme.css> [options]
95
- ```
96
-
97
- Performs a comprehensive audit of the generated CSS against type-specific design constraints and prints a compliance score.
98
-
99
- Options:
100
-
101
- | Flag | Description |
102
- |------|-------------|
103
- | `-t, --type <type>` | Document type: `document` (meeting minutes, reports), `design` (web page conversions), `ppt` (PDF from slides) |
104
- | `-s, --source <file>` | Source file (DOCX/PDF) to compare against (used for PPT type) |
105
- | `-f, --format <fmt>` | Report format: `text` (default), `json`, `html` |
106
- | `--strict` | Exit with non-zero code on ANY violation (default: only MUST/MUST_NOT failures) |
107
-
108
- The audit checks:
109
-
110
- - Color values against type expectations
111
- - Font stacks for appropriateness
112
- - Pele chart palette suitability (`--pele-*` derives from code block colors)
113
- - Print fidelity (2.7 exports the current window; `@media print` only needs `print-color-adjust`)
114
- - Contrast ratios and accessibility
115
- - Conformance to the 2.7 contract (`:root` vars, `.cm-md-*` selectors, no dead variables)
116
-
117
- Output includes overall score (0–100) and categorized issues (CRITICAL, WARNING, INFO).
118
-
119
- Example:
120
-
121
- ```
122
- Audit: meeting-minutes.css (type: document)
123
- Overall score: 92/100
124
-
125
- CRITICAL:
126
- (none)
127
-
128
- WARNINGS:
129
- - Accent saturation 0.72 exceeds document-type max 0.6
130
- - Consider a more muted blue for formal documents
131
-
132
- INFO:
133
- - Chart palette: derived from `--pele-*`
134
- - Font stack includes CJK fallbacks: Yes
135
- ```
136
-
137
- ## Built-in Demo Content
138
-
139
- The preview includes this sample Markdown structure:
140
-
141
- ```
142
- # Heading 1
143
- ## Heading 2
144
- ### Heading 3
145
-
146
- Paragraph with **bold**, *italic*, `inline code`, [links](https://example.com), and ~~strikethrough~~.
147
-
148
- > Blockquote with *emphasized* text and a link.
149
-
150
- - Unordered list item 1
151
- - Unordered list item 2
152
- - Nested item
153
- - Another nested item
154
-
155
- 1. Ordered list item 1
156
- 2. Ordered list item 2
157
- 1. Nested ordered item
158
-
159
- - [ ] Task list item (unchecked)
160
- - [x] Task list item (checked)
161
-
162
- ```python
163
- def hello():
164
- print("Hello, ColaMD!")
165
- ```
166
-
167
- | Header 1 | Header 2 | Header 3 |
168
- |----------|----------|----------|
169
- | Cell 1 | Cell 2 | Cell 3 |
170
- | Cell 4 | Cell 5 | Cell 6 |
171
-
172
- ---
173
-
174
- ```mermaid
175
- graph TD
176
- A[Start] --> B{Decision}
177
- B --> C[Option 1]
178
- B --> D[Option 2]
179
- ```
180
-
181
- $$
182
- \int_{a}^{b} x^2 dx
183
- $$
184
-
185
- ---
186
-
187
- [[toc]]
188
- ```
189
-
190
- ## HTML Preview Features
191
-
192
- Generated preview pages include:
193
-
194
- 1. **Theme metadata bar** — name, color system, mermaid preset
195
- 2. **Color palette swatches** — seed colors displayed as swatches
196
- 3. **Typography samples** — heading and body font renders
197
- 4. **Full Markdown rendering** — all ColaMD-supported elements
198
- 5. **Print preview toggle** — switch to print stylesheet view
199
- 6. **Mobile responsive toggle** — simulate mobile viewport
200
- 7. **CSS source viewer** — collapsible panel to inspect the theme file
201
- 8. **Download button** — export the theme CSS
202
-
203
- ## Batch Comparison Layout
204
-
205
- Comparison page organizes themes horizontally (if < 4 themes) or in tabs:
206
-
207
- - **Color palette matrix** — side-by-side swatch comparison
208
- - **Shared scroll container** — all themes scroll together
209
- - **Highlight differences** — hover a theme to emphasize it
210
- - **Export all** — zip all themes + preview HTML
211
-
212
- ## Development Server Workflow
213
-
214
- ```bash
215
- # Start server with watch
216
- colamd-themes-preview serve -w themes/
217
-
218
- # In another terminal, edit your theme CSS
219
- # Browser auto-refreshes on save
220
- ```
221
-
222
- The server serves:
223
- - `/` — theme selector + preview
224
- - `/preview/<theme-name>` — single theme preview
225
- - `/compare` — batch comparison (query: ?themes=a.css,b.css)
226
- - `/demo-content.md` — raw demo content
227
-
228
- ## Integration with colamd-themes
229
-
230
- Typical workflow:
231
-
232
- 1. Extract theme:
233
- ```bash
234
- colamd-themes extract source.docx --name my-theme --auto-match
235
- ```
236
-
237
- 2. Preview it:
238
- ```bash
239
- colamd-themes-preview generate themes/my-theme.css --embedded
240
- ```
241
-
242
- 3. Fine-tune seed colors manually in `themes/my-theme.css` (SECTION 1 only)
243
-
244
- 4. Re-preview instantly with dev server:
245
- ```bash
246
- colamd-themes-preview serve -w themes/
247
- ```
248
-
249
- 5. Validate:
250
- ```bash
251
- colamd-themes validate themes/my-theme.css
252
- ```
253
-
254
- 6. (Optional) Compare with alternatives:
255
- ```bash
256
- colamd-themes-preview compare themes/*.css
257
- ```
258
-
259
- 7. Audit against document type expectations:
260
- ```bash
261
- colamd-themes-preview audit themes/my-theme.css --type document
262
- ```
263
-
264
- ## Code Audit Rules
265
-
266
- The `audit` command validates a theme against expectations for its document type. Rules are prioritized:
267
-
268
- - **MUST** / **MUST_NOT** — critical non-negotiable constraints (fail audit)
269
- - **SHOULD** / **SHOULD_NOT** — recommended best practices (warnings)
270
- - **INFO** — informational notes (no score impact)
271
-
272
- ### Document Type Rules
273
-
274
- **Document** (meeting minutes, reports, proposals):
275
-
276
- - Surface: near-white (Luminance ≥ 0.95)
277
- - Ink: dark (Luminance ≤ 0.2 or hex `#000000`–`#222222`)
278
- - Accent: medium saturation (0.3 ≤ S ≤ 0.6), professional hues (blue, teal, burgundy)
279
- - Chart palette: muted `--pele-*` derived from code block tones
280
- - Font bodies: serif or clean sans-serif, include CJK fallbacks
281
- - Print styles: no mirrored color block needed; `@media print` only carries `print-color-adjust: exact`
282
- - Expectation: readability, print-friendliness, conservative palette
283
-
284
- **Design** (web page style conversions):
285
-
286
- - Surface: varies (light or dark)
287
- - Accent: high saturation (S ≥ 0.6), vibrant colors, possible gradients
288
- - Font families: modern sans-serif stack, may include display fonts
289
- - Chart palette: `--pele-*` tuned to the background luminance
290
- - Print styles: SHOULD preserve brand colors; if source has print styles, compare against them
291
- - Expectation: faithful reproduction of source website's visual identity
292
-
293
- **PPT** (PDF from presentation slides):
294
-
295
- - Must preserve original slide color scheme (extracted from source PDF)
296
- - Text colors must match original slide text colors within tolerance
297
- - Chart colors should follow slide accent palette (`--pele-accent`)
298
- - Font choices should reflect slide typography
299
- - Print styles: CRITICAL — 2.7 prints the current window, so screen rules apply as-is; verify `@media print` carries `print-color-adjust: exact`
300
- - Expectation: high fidelity to original slide design, including print output
301
-
302
- ## Implementation Notes
303
-
304
- - Preview HTML uses a simple client-side renderer (marked.js or similar)
305
- - No additional build step required — copies template + injects theme CSS
306
- - Embedded mode inlines the entire CSS to avoid CORS issues when sharing
307
- - Dev server uses `chokidar` for file watching and `ws` for live reload WebSocket
308
-
309
- ## File Structure
310
-
311
- ```
312
- ColaMD-themes/
313
- ├── .claude/skills/
314
- │ ├── colamd-themes.skill.md (existing)
315
- │ └── colamd-themes-preview.skill.md (this skill)
316
- ├── src/
317
- │ ├── preview/
318
- │ │ ├── preview-server.ts (dev server)
319
- │ │ ├── generate-html.ts (static HTML generator)
320
- │ │ ├── demo-content.md (built-in Markdown sample)
321
- │ │ └── template.html (HTML skeleton)
322
- │ └── cli.ts (+ new subcommands)
323
- ├── themes-preview/ (output directory)
324
- └── package.json (adds preview deps)
325
- ```
326
-
327
- ## Future Enhancements
328
-
329
- - Screenshot automation (puppeteer) for documentation
330
- - Export to PDF with print styles applied
331
- - Share to ColaMD community gallery
332
- - AI-driven theme critique (color harmony, contrast feedback)
333
- - Theme package (.zip) with preview, demo, and license
@@ -1,10 +0,0 @@
1
- ---
2
- name: colamd-themes
3
- description: >
4
- Generate, validate, export, and manage ColaMD 2.7.7 contract CSS themes.
5
- Extract formatting from URLs, DOCX, or PDF sources; export Markdown to
6
- standalone HTML/PDF with themes applied; batch export; manage theme
7
- configuration.
8
- ---
9
-
10
-
@@ -1,14 +0,0 @@
1
- ---
2
- name: colamd-themes
3
- version: "1.0.0"
4
- description: >
5
- Generate, validate, export, and manage ColaMD 2.7.7 contract CSS themes.
6
- Extract from URLs/DOCX/PDF; export Markdown to HTML/PDF; batch export.
7
- metadata:
8
- dsh:
9
- tags: [colamd, themes, css, markdown, export, pdf, html]
10
- prerequisites:
11
- commands: [node, npm]
12
- ---
13
-
14
-
@@ -1,17 +0,0 @@
1
- # GitHub Topics 支持列表
2
- # 此文件帮助 GitHub 在仓库设置页面自动建议相关 topics
3
- # 添加后需在 GitHub 仓库 Settings > General > Topics 中手动确认保存
4
- - dsh
5
- - deepseek-harness
6
- - colamd
7
- - themes
8
- - css
9
- - markdown
10
- - pdf
11
- - html
12
- - skill
13
- - ai-agent
14
- - agent-skill
15
- - theme-generator
16
- - markdown-export
17
- - colamd-themes
@@ -1,14 +0,0 @@
1
- ---
2
- name: colamd-themes
3
- description: "Generate, validate, export, and manage ColaMD 2.7.7 contract CSS themes."
4
- version: 1.0.0
5
- author: bytechain
6
- license: MIT
7
- metadata:
8
- hermes:
9
- tags: [colamd, themes, css, markdown, export, pdf, html]
10
- prerequisites:
11
- commands: [node, npm]
12
- ---
13
-
14
-
@@ -1,21 +0,0 @@
1
- ---
2
- id: colamd-themes
3
- name: ColaMD Themes
4
- description: >
5
- Generate, validate, export, and manage ColaMD 2.7.7 contract CSS themes.
6
- Extract from URLs/DOCX/PDF; export Markdown to HTML/PDF; batch export.
7
- version: "1.0.0"
8
- icon: "\U0001F3A8"
9
- author: bytechain
10
- homepage: https://github.com/byteuser1977/ColaMD-themes
11
- user-invocable: true
12
- metadata:
13
- openclaw:
14
- os: [darwin, linux, win32]
15
- clawdbot:
16
- emoji: "\U0001F3A8"
17
- requires:
18
- bins: [node, npm]
19
- ---
20
-
21
-
@@ -1,17 +0,0 @@
1
- ---
2
- name: colamd-themes
3
- version: "1.0.0"
4
- description: >
5
- Generate, validate, export, and manage ColaMD 2.7.7 contract CSS themes.
6
- Extract from URLs/DOCX/PDF; export Markdown to HTML/PDF; batch export.
7
- user-invocable: true
8
- allowed-tools:
9
- - Read
10
- - Write
11
- - Edit
12
- - Bash
13
- - Glob
14
- - Grep
15
- ---
16
-
17
-
@@ -1,5 +0,0 @@
1
- # ColaMD Themes Skill Instructions
2
-
3
- When the user asks to create, validate, export, or manage ColaMD themes, use the following CLI tool:
4
-
5
-