vscode-colaview 0.3.3 → 0.4.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.
Files changed (43) hide show
  1. package/.release-notes-v0.4.1.md +29 -0
  2. package/.vscode/settings.json +1 -1
  3. package/CHANGELOG.md +45 -16
  4. package/README.md +318 -287
  5. package/README_CN.md +318 -287
  6. package/RELEASE_NOTES.md +80 -21
  7. package/esbuild.js +2 -0
  8. package/package.json +204 -164
  9. package/package.nls.json +14 -0
  10. package/package.nls.zh-cn.json +14 -0
  11. package/src/commands/commands.ts +48 -0
  12. package/src/docx/docx-builder.ts +241 -0
  13. package/src/export/docx-exporter.ts +961 -961
  14. package/src/export/html-exporter.ts +8 -2
  15. package/src/export/pdf-exporter.ts +69 -0
  16. package/src/export/pptx-exporter.ts +63 -0
  17. package/src/export/render-export-images.ts +386 -386
  18. package/src/export/theme-style.ts +195 -195
  19. package/src/pptx/pptx-builder.ts +249 -0
  20. package/src/pptx/zip.ts +158 -0
  21. package/src/present/presenter.ts +89 -0
  22. package/src/preview/preview-manager.ts +783 -541
  23. package/src/preview/webview/app.ts +695 -370
  24. package/src/preview/webview/index.html +167 -146
  25. package/src/slides/deck.ts +408 -0
  26. package/src/slides/markdown.ts +420 -0
  27. package/src/slides/render.ts +580 -0
  28. package/src/slides/slides.css +1082 -0
  29. package/src/themes/built-in/bear.css +64 -13
  30. package/src/themes/built-in/dark.css +64 -5
  31. package/src/themes/built-in/dracula.css +64 -5
  32. package/src/themes/built-in/elegant.css +75 -11
  33. package/src/themes/built-in/gruvbox.css +65 -6
  34. package/src/themes/built-in/light.css +62 -2
  35. package/src/themes/built-in/midnight.css +64 -6
  36. package/src/themes/built-in/nord.css +64 -5
  37. package/src/themes/built-in/notion.css +63 -11
  38. package/src/themes/built-in/sepia.css +65 -10
  39. package/src/themes/built-in/solarized-dark.css +64 -5
  40. package/src/themes/built-in/writer.css +66 -19
  41. package/src/themes/theme-manager.ts +207 -180
  42. package/src/types/colamd-renderer.d.ts +47 -47
  43. package/src/types/pele-lazy.d.ts +21 -0
package/README.md CHANGED
@@ -1,287 +1,318 @@
1
- # ColaView MD
2
-
3
- [![VS Code](https://img.shields.io/badge/VS_Code-1.85%2B-007ACC?logo=visual-studio-code)](https://code.visualstudio.com/)
4
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-3178C6?logo=typescript)](https://www.typescriptlang.org/)
5
- [![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
6
- [![Version](https://img.shields.io/badge/Version-0.3.3-orange)](package.json)
7
-
8
- Rich Markdown preview & PDF/HTML/Word export for VS Code — powered by [ColaMD](https://github.com/byteuser1977/ColaMD-extend) rendering engine (CodeMirror 6 based).
9
-
10
- ## Features
11
-
12
- - **WYSIWYG Preview** — CodeMirror 6 powered read-only editor renders Markdown as rich text in real-time, with source buffer as the single source of truth
13
- - **Math Formulas** — KaTeX integration for inline `$...$` and display `$$...$$` expressions (fonts inlined via base64)
14
- - **Mermaid Diagrams** — 17+ chart types: flowcharts, sequence, class, state, ER, Gantt, mind maps, etc.
15
- - **PDF Export** — Puppeteer headless Chrome renders A4 PDF with full theme styling
16
- - **HTML Export** — Standalone `.html` with embedded CSS and fonts, zero-dependency sharing
17
- - **Word Export** — High-fidelity `.docx` with headings, lists, tables, images, code blocks, footnotes, and rasterized KaTeX/Mermaid
18
- - **Theme-Faithful Export** — PDF/HTML/Word exports inherit the current preview theme's fonts, accent colors, table styling and blockquote padding
19
- - **12 Built-in Themes** — Light, Dark, Elegant, Sepia, Notion, Bear, Writer, Solarized Dark, Nord, Gruvbox, Dracula, Midnight
20
- - **Custom Theme Directory** — Drop `.css` files into `.themes/` folder in your workspace root; they appear automatically in the theme menu
21
- - **Right-click Context Menu** — Export HTML/PDF, switch theme (with submenu), import custom theme — all from within the preview panel
22
- - **Live Sync** — 150ms debounced update while editing, experimental scroll sync between editor and preview
23
- - **Source Buffer Fidelity** — Raw Markdown bytes are preserved exactly; export uses the buffer content directly, no serialization loss
24
-
25
- ## Quick Start
26
-
27
- 1. Install the extension
28
- 2. Open a `.md` file in VS Code
29
- 3. `Ctrl+Shift+P` → **"ColaView MD: Show Preview"**
30
- 4. Preview opens in a side panel with rich rendering
31
-
32
- ## Commands & Usage
33
-
34
- ### Command Palette (`Ctrl+Shift+P`)
35
-
36
- | Command | Description |
37
- |---------|-------------|
38
- | `ColaView MD: Show Preview` | Open or focus the preview panel |
39
- | `ColaView MD: Export to PDF...` | Export current file as A4 PDF |
40
- | `ColaView MD: Export to HTML...` | Export as standalone HTML |
41
- | `ColaView MD: Export to Word...` | Export current file as `.docx` Word document |
42
- | `ColaView MD: Switch Preview Theme...` | Choose from 12 built-in + custom themes |
43
- | `ColaView MD: Import Custom Theme...` | Load a `.css` file as custom theme |
44
-
45
- ### Right-click Context Menu (in Preview)
46
-
47
- When the preview is open, right-click anywhere to access:
48
-
49
- | Menu Item | Description |
50
- |-----------|-------------|
51
- | **Export HTML** | Export current preview as standalone HTML |
52
- | **Export PDF** | Export current preview as A4 PDF |
53
- | **Export Word** | Export current preview as `.docx` Word document |
54
- | **Theme ▸** | Submenu listing all built-in + custom themes (✓ marks active) |
55
- | **Import Theme...** | Open file picker to import a `.css` file |
56
-
57
- ## Themes
58
-
59
- ### Built-in Themes
60
-
61
- | Theme | Style | Best For |
62
- |-------|-------|----------|
63
- | **Light** | Clean white, blue accents | General use, documentation |
64
- | **Dark** | GitHub Dark palette | Night coding |
65
- | **Elegant** | Warm serif, beige tones | Academic papers, long-form |
66
- | **Sepia** | Warm sepia, paper texture | Extended reading, low-eye-strain |
67
- | **Notion** | Not.so MCP | Notion-like clean minimalism |
68
- | **Bear** | Bear.app style | Note-taking, casual writing |
69
- | **Writer** | Monospace-friendly | Technical writing, code-heavy docs |
70
- | **Solarized Dark** | Ethan Schoonover palette | Low-contrast dark coding |
71
- | **Nord** | Arctic blue palette | Calm, focused writing |
72
- | **Gruvbox** | Retro 80s terminal | Nostalgia, high-contrast |
73
- | **Dracula** | Zeno Rocha palette | Vibrant dark theme |
74
- | **Midnight** | Deep navy, gold accents | Night writing, premium feel |
75
-
76
- ### Custom Themes
77
-
78
- Place `.css` files in the `.themes/` directory at your workspace root. Two custom themes are bundled with the extension:
79
-
80
- | Theme | Style | Best For |
81
- |-------|-------|----------|
82
- | **Academic Paper** | GB/T 7713 standard, serif body, three-line tables, black-on-white | Academic papers, formal documents, printing |
83
- | **Trae Blue** | Trae IDE documentation style, white + Slate gray, blue accents | Technical docs, modern documentation |
84
-
85
- ```
86
- my-project/
87
- ├── .themes/
88
- │ ├── my-dark.css # appears as "My-dark" in theme menu
89
- │ └── corporate.css # appears as "Corporate" in theme menu
90
- └── README.md
91
- ```
92
-
93
- Custom themes are automatically detected and appear alongside built-in themes in both the command palette and right-click context menu.
94
-
95
- Switch via command palette or settings:
96
-
97
- ```json
98
- { "colaview.theme": "nord" }
99
- ```
100
-
101
- Import custom CSS: `Ctrl+Shift+P` → "ColaView MD: Import Custom Theme..." or via right-click menu → "Import Theme..."
102
-
103
- ## Configuration
104
-
105
- | Setting | Type | Default | Description |
106
- |---------|------|---------|-------------|
107
- | `colaview.theme` | `string` | `"elegant"` | Preview theme: `light`, `dark`, `elegant`, `sepia`, `notion`, `bear`, `writer`, `solarized-dark`, `nord`, `gruvbox`, `dracula`, `midnight`, or any custom theme name |
108
- | `colaview.autoPreview` | `boolean` | `false` | Auto-open preview for `.md` files |
109
- | `colaview.scrollSync` | `boolean` | `false` | **Experimental** — Enable scroll sync between editor and preview |
110
-
111
- ## Supported Syntax
112
-
113
- **Standard Markdown** — Headings, bold, italic, strikethrough, code blocks, links, images, lists, blockquotes
114
-
115
- **GFM Extensions** — Tables, task lists, footnotes, autolinks
116
-
117
- **Math (KaTeX)**
118
-
119
- ```markdown
120
- Inline: $E = mc^2$
121
-
122
- Display:
123
- $$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$
124
- ```
125
-
126
- **Diagrams (Mermaid)**
127
-
128
- ````markdown
129
- ```mermaid
130
- graph LR
131
- A[Markdown] --> B[ColaView]
132
- B --> C[PDF]
133
- B --> D[HTML]
134
- ```
135
- ````
136
-
137
- Supports: flowchart, sequence, class, state, ER, journey, pie, Gantt, gitGraph, mindmap, timeline, quadrant, XY, C4, Sankey, block, architecture
138
-
139
- ## Architecture
140
-
141
- ```
142
- ┌─────────────┐ postMessage ┌──────────────────┐
143
- │ Extension │ ◄──────────────────► │ WebView │
144
- │ (Node.js) │ │ (CodeMirror 6/ │
145
- │ │ raw markdown ──► │ ColaMD renderer)│
146
- │ ThemeManager│ theme/css ──► │ │
147
- │ Exporters │ ◄── complete HTML │ Read-only rich │
148
- │ │ │ preview + Menu │
149
- └─────────────┘ └──────────────────┘
150
- ```
151
-
152
- **Key design:** The extension sends raw Markdown to the WebView, where ColaMD (CodeMirror 6 based) renders it as a read-only rich preview. The source buffer is the single source of truth — no serialization loss on export. For exports, the WebView asynchronously builds a complete standalone HTML (including KaTeX fonts, Mermaid SVGs, and theme CSS) and returns it to the extension.
153
-
154
- ### Security Model
155
-
156
- The WebView uses a strict Content-Security-Policy (CSP):
157
-
158
- 1. `style-src 'unsafe-inline'` is required for CodeMirror 6's dynamic styling and KaTeX's inline fonts
159
- 2. `script-src 'unsafe-inline'` is required for esbuild's IIFE bundle format
160
- 3. All resource URIs are resolved through `webview.asWebviewUri()` for sandbox isolation
161
- 4. This prevents XSS injection even if markdown content contains malicious scripts
162
-
163
- ### Project Structure
164
-
165
- ```
166
- src/
167
- ├── extension.ts # Entry point (activate/deactivate), error isolation
168
- ├── commands/commands.ts # Command registration (showPreview, exportHTML, exportPDF, etc.)
169
- ├── preview/
170
- │ ├── preview-manager.ts # WebView lifecycle, message handling, debounce sync
171
- │ └── webview/
172
- │ ├── index.html # WebView template + context menu styles
173
- │ └── app.ts # ColaMD (CM6) init + context menu + scroll sync
174
- ├── export/
175
- │ ├── pdf-exporter.ts # Puppeteer PDF generation (A4, print background)
176
- │ ├── html-exporter.ts # Standalone HTML export (embedded CSS)
177
- │ ├── docx-exporter.ts # Word (.docx) export via docx + remark-parse/remark-gfm
178
- │ ├── render-export-images.ts # KaTeX/Mermaid → PNG (headless Chrome) for Word export
179
- │ └── theme-style.ts # Theme CSS → semantic HTML style converter for exports
180
- ├── themes/
181
- │ ├── theme-manager.ts # Theme loading, switching, .themes/ directory scanning, import
182
- │ ├── foundation.css # Base CSS variables (colors, spacing)
183
- │ └── built-in/ # 12 built-in themes (light.css, dark.css, elegant.css, sepia.css, ...)
184
- └── types/
185
- └── colamd-renderer.d.ts # Local type declarations for ColaMD 2.7.9 npm package
186
- ```
187
-
188
- ## Development
189
-
190
- ```bash
191
- git clone https://github.com/bytechain/vscode-colaview.git
192
- cd vscode-colaview
193
- npm install
194
-
195
- # Build (esbuild bundles all deps into out/)
196
- npm run build
197
-
198
- # Watch mode
199
- npm run watch
200
-
201
- # Package .vsix
202
- npm run package
203
-
204
- # Debug: press F5 in VS Code to launch Extension Development Host
205
- ```
206
-
207
- ### Build System
208
-
209
- The project uses **esbuild** for bundling — the extension side (`out/extension.js`) is a small CJS bundle with only VS Code API imports. The WebView side (`out/preview/webview/app.js`) is an IIFE bundle containing the full ColaMD 2.7.13-rc.1 rendering engine (CodeMirror 6 + Mermaid + KaTeX) — approximately 3.5MB unminified, gzip ~400KB. Resource files (CSS, WebView HTML, KaTeX stylesheet, Mermaid script) are copied to `out/` during build so they survive `.vscodeignore` packaging.
210
-
211
- ## Changelog
212
-
213
- ### v0.3.3 (Current)
214
-
215
- - **🔧 Engine Upgrade — ColaMD 2.7.13-rc.1, No More Patches** — the CM6 whole-line replace-decoration fix (`block: true`, previously a `patch-package` patch) is now native to the engine and extended to tables and HTML blocks; the `patches/` directory is gone. The engine's mermaid palette is page-based as well.
216
- - **🎨 Mermaid Diagrams Drawn on the Page** — preview and HTML/PDF exports derive the `--pele-*` tokens from page colors (`--bg-color`/`--text-color`, 18%/28%/45% mixes) instead of code-block colors, and no longer paint a code-block background behind diagrams — matching ColaMD-extend 2.7.13-rc.1. Most visible with Elegant/Bear, which previously drew pale lines on the dark code block.
217
- - **🐛 Theme Variables Actually Apply Now** — the engine's `body.theme-x` variables (specificity 0,1,1) always beat the injected `:root` (0,1,0), so theme-file variable values were ignored in the preview. Theme CSS is now injected as `:root, body.theme-x`; exports apply the same scoping.
218
- - **🎨 All 12 Built-in Themes Synced with ColaMD-extend** — border colors refined in every theme; Dark/Midnight/Writer add strong/inline-code accents; Notion swaps link underlines for strong/URL colors; blockquote overrides trimmed; Elegant drops the dead `--table-border` variable.
219
- - **🎨 Word Export: Readable Colors on White Paper** — dark themes fall back entirely to the light palette; light themes with a dark code block (Elegant/Bear) draw diagrams on white with body-text color.
220
-
221
- ### v0.3.2
222
-
223
- - **🐛 PDF/HTML Export Fixed (`md is not defined`)** — exporting failed with "PDF export failed: md is not defined": a CSS comment inside the export stylesheet template literal contained unescaped backticks, which closed the literal early and made the parser treat part of the comment as JavaScript. Backticks are now escaped.
224
- - **🐛 PDF/HTML Mermaid Diagrams Centered** — the engine serializes mermaid blocks as class-stripped `<p><svg class="pele pele-…">…</svg></p>`, so the previous `div:has(> svg.pele)` export rule never matched and diagrams were left-aligned on paper. Centering now applies to `svg.pele` itself (`display: block; margin: 0 auto`), independent of the wrapper element.
225
- - **🎨 Mermaid Diagram Background Matches ColaMD-extend** — diagrams are now drawn on the code-block background (`--code-block-bg`, 6px radius, `0.8em 1em` padding) in both the preview and HTML/PDF exports, matching ColaMD instead of floating on the plain page background (most visible with Elegant/Bear, whose dark code blocks sit on light pages).
226
- - **🎨 Mermaid Colors Match the Preview in Every Theme** — non-Elegant themes exported diagrams with different node/edge/label colors because the export re-declared `--pele-*` on a `div:has(> svg.pele)` selector that never matched the serialized `<p><svg class="pele">` markup, leaving pele's built-in palette in effect. Exports now use the runtime values collected from the preview into `:root`, with the derived token block injected only when those values are absent.
227
- - **🧹 Removed Ineffective Settings** — `colaview.plugins.math` / `colaview.plugins.mermaid` (no-ops since v0.3.0) and `colaview.pdfMethod` / `colaview.customThemesPath` (never read) are gone; remaining settings: `colaview.theme`, `colaview.autoPreview`, `colaview.scrollSync`.
228
- - **🐛 Preview Blocks No Longer Vanish After Source View** — Fixed an engine bug (multi-line inline replace decorations are ignored by CodeMirror 6 on incremental updates): clicking a mermaid diagram / multi-line block formula to view its source, then clicking away, no longer makes the whole block disappear. Patched via `patch-package`; fix also applied upstream in ColaMD-extend.
229
- - **🐛 Word Export Images Fixed** — puppeteer v25 screenshot returns `Uint8Array`; the previous base64 conversion produced corrupt data so formulas/diagrams appeared as placeholder text in the `.docx`. Now converted with `Buffer.from()`.
230
- - **🐛 Word Formula Glyphs Fixed** — KaTeX fonts are inlined as base64 into the screenshot page (the relative `fonts/*.woff2` URLs could not resolve), so formulas render with proper KaTeX fonts.
231
- - **🎨 Exports Match Preview Colors** — The engine's theme-scoped body rules (bold/inline-code/heading accent colors per theme) are translated to semantic selectors and injected into HTML/PDF exports for all 12 themes.
232
-
233
- ### v0.3.1
234
-
235
- - **🔧 Engine Upgrade — ColaMD 2.7.11** — Inline math in table cells, CSS-driven list indent, block widget layout fixes, official CM6 typing commands.
236
- - **🎨 Word Mermaid Diagrams Follow Theme** — Diagram colors derived from the current preview theme's tokens (dark themes fall back to light), instead of mermaid's hardcoded `neutral`.
237
- - **🐛 Windows Word Code Blocks Fixed** — Platform mono font in all four `w:rFonts` slots + CJK `eastAsia` font, explicit left alignment, light border, `noProof` (port of ColaMD-extend #202).
238
- - **🐛 Inline Formulas No Longer Wrap** — Wider (2000px) measurement viewport before capture.
239
- - **🐛 HTML/PDF Diagrams Follow Theme + No Zoom Controls** — Export CSS matches serialized pele SVG wrappers to restore `--pele-*` variables; editor-only zoom controls hidden on paper.
240
-
241
- ### v0.3.0
242
-
243
- - **📝 Word Export (`.docx`)** — Ported from ColaMD-extend. High-fidelity Word export with headings, paragraphs, inline styles, code blocks, lists, tables, blockquotes, horizontal rules, images, footnotes, and rasterized KaTeX/Mermaid diagrams.
244
- - **🎨 Theme-Faithful Export** — New `theme-style.ts` conversion layer maps editor-only theme selectors (`#editor .cm-content .cm-md-*`) to semantic HTML selectors, so PDF/HTML/Word exports inherit the current preview theme's fonts, accent colors, table header styling and blockquote padding.
245
- - **🐛 PDF Blank Export Fixed** — Stripped ColaMD's Electron `@media print` rule that hid the exported `<article>` element, so PDF (and HTML) export no longer renders blank.
246
- - **🐛 HTML Export Theme Fix** — Fixed exported HTML not applying preview theme styles due to the editor-only selector mismatch.
247
- - **📦 New Dependencies** — `docx`, `katex`, `remark-parse`, `remark-gfm`, `unified`.
248
- - **🔧 Engine Upgrade — ColaMD 2.7.9 (CodeMirror 6)** — Migrated from Milkdown/ProseMirror to CodeMirror 6. Source buffer is now the single source of truth with zero serialization loss on export.
249
- - **🎨 12 Built-in Themes** — Expanded from 4 to 12 themes: Light, Dark, Elegant, Sepia, Notion, Bear, Writer, Solarized Dark, Nord, Gruvbox, Dracula, Midnight. Default theme changed to Elegant.
250
- - **📤 Async HTML Export** — `buildExportHTML()` is now asynchronous, automatically waits for Mermaid diagrams and KaTeX fonts to render before producing the final HTML.
251
- - **🗑️ Removed Plugin Toggle** — Math and Mermaid are now integral to the ColaMD engine; `colaview.plugins.math` and `colaview.plugins.mermaid` settings are no longer functional.
252
- - **📰 Removed Newsprint Theme** — Newsprint is not available in ColaMD 2.7.9.
253
- - **🔄 DOM Structure Changed** — The preview container uses `.cm-editor` / `.cm-scroller` / `.cm-content` instead of `.ProseMirror`. Scroll sync target updated to `.cm-scroller`.
254
- - **📦 Dependency Bump** — `@bytechain.cn/colamd` upgraded from `^1.5.2` to `^2.7.9`. TypeScript type declarations added locally since 2.7.9 npm package does not publish `.d.ts` files.
255
- - **🖼️ KaTeX Fonts Inlined** — KaTeX fonts are base64-encoded inside `colamd.css`, no additional resource paths needed for PDF export.
256
-
257
- ### v0.2.0
258
-
259
- - **🏗️ Architecture Overhaul** — Error-isolated activation, refactored PreviewManager, runtime plugin toggle sync for math/mermaid settings
260
- - **🖱️ Right-Click Context Menu** — Export HTML/PDF, switch theme (with submenu), import custom theme — directly in the preview panel
261
- - **🎨 New Custom Themes** — Academic Paper (GB/T 7713 standard) and Trae Blue (Trae IDE documentation style)
262
- - **🧹 Cleanup** — Removed obsolete files (`debug-load.js`, `configuration.ts`, `file-utils.ts`)
263
- - **🐛 Fixes** — h4 color consistency, code block border color, print margin width
264
-
265
- ### v0.1.3
266
-
267
- - **🔄 Experimental Scroll Sync** — Bidirectional scroll synchronization between editor and preview panel. Enable via `colaview.scrollSync` setting.
268
- - Enhanced error handling in extension activation and preview manager initialization
269
-
270
- ### v0.1.2
271
-
272
- - **🐛 Blockquote Background Fix** — Fixed blockquote background color being overridden by page background in Dark, Light, and Newsprint themes
273
-
274
- ### v0.1.1
275
-
276
- - **🎨 Theme Consistency Fix** — Unified `--code-color` and `--code-block-text` CSS variables across all 4 built-in themes (Light, Dark, Elegant, Newsprint), eliminating inconsistent inline code / code block text colors
277
- - **📰 Newsprint Theme Alignment** — Fully aligned Newsprint theme variables with [ColaMD-extend](https://github.com/byteuser1977/ColaMD-extend) base.css, including font family (PT Serif serif stack), code color inheritance, and all semantic color tokens
278
- - **🔧 Light Theme Completion** — Added missing `--table-border` variable to Light theme for consistent table styling
279
- - **📦 Dependency Migration** — Switched from local ColaMD project reference to npm package `@bytechain.cn/colamd` (^1.5.2)
280
-
281
- ### v0.1.0
282
-
283
- - Initial release with WYSIWYG preview, PDF/HTML export, 4 built-in themes, custom theme support
284
-
285
- ## License
286
-
287
- [MIT](LICENSE)
1
+ # ColaView MD
2
+
3
+ [![VS Code](https://img.shields.io/badge/VS_Code-1.85%2B-007ACC?logo=visual-studio-code)](https://code.visualstudio.com/)
4
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-3178C6?logo=typescript)](https://www.typescriptlang.org/)
5
+ [![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
6
+ [![Version](https://img.shields.io/badge/Version-0.4.1-orange)](package.json)
7
+
8
+ Rich Markdown preview & PDF/HTML/Word export for VS Code — powered by [ColaMD](https://github.com/byteuser1977/ColaMD-extend) rendering engine (CodeMirror 6 based).
9
+
10
+ ## Features
11
+
12
+ - **WYSIWYG Preview** — CodeMirror 6 powered read-only editor renders Markdown as rich text in real-time, with source buffer as the single source of truth
13
+ - **Slide Preview & Presenting** — a separate render layer reusing the upstream `slides.css` line contract; pages split by `<!-- slide: cover -->`-style directives at 1920×1080, with fullscreen presenting (←/→ paging, `F` fullscreen) for both documents and slides
14
+ - **Math Formulas** — KaTeX integration for inline `$...$` and display `$$...$$` expressions (fonts inlined via base64)
15
+ - **Mermaid Diagrams** — 17+ chart types: flowcharts, sequence, class, state, ER, Gantt, mind maps, etc.
16
+ - **PDF Export** — Puppeteer headless Chrome renders A4 PDF with full theme styling (slides: one 1920×1080 page each)
17
+ - **HTML Export** — Standalone `.html` with embedded CSS and fonts, zero-dependency sharing (slides: `.slides.html` with paging and fullscreen)
18
+ - **Word Export** — High-fidelity `.docx` with headings, lists, tables, images, code blocks, footnotes, and rasterized KaTeX/Mermaid
19
+ - **PPTX Export** — Native PowerPoint (16:9), one slide per page, zero-dependency OOXML
20
+ - **Theme-Faithful Export** — PDF/HTML/Word exports inherit the current preview theme's fonts, accent colors, table styling and blockquote padding
21
+ - **DSH-Aligned Rendering** — fonts, 820px content column, line-height/letter-spacing and heading metrics follow the ColaMD 2.8 contract and the DSH plugin's BASE_CSS; themes mirror JetBrains Mono / Fira Code webfonts and keep their own font identity (Elegant serif, Writer mono…)
22
+ - **12 Built-in Themes** — Light, Dark, Elegant, Sepia, Notion, Bear, Writer, Solarized Dark, Nord, Gruvbox, Dracula, Midnight
23
+ - **Custom Theme Directory** — Drop `.css` files into `.themes/` folder in your workspace root; they appear automatically in the theme menu
24
+ - **Right-click Context Menu** — Present (fullscreen) pinned first; exports follow the current mode (documents: PDF/HTML/Word, slides: PDF/PPTX); grouped theme submenu (Built-in · Light / Dark / Custom, scrollable) and import theme
25
+ - **Live Sync** — 150ms debounced update while editing, experimental scroll sync between editor and preview
26
+ - **Source Buffer Fidelity** — Raw Markdown bytes are preserved exactly; export uses the buffer content directly, no serialization loss
27
+
28
+ ## Quick Start
29
+
30
+ 1. Install the extension
31
+ 2. Open a `.md` file in VS Code
32
+ 3. `Ctrl+Alt+V` opens the preview (or `Ctrl+Shift+P` → **"Show Preview"**)
33
+ 4. The preview opens in a side panel with rich rendering; `Ctrl+Alt+S` switches to the slides deck
34
+
35
+ Menu and Command Palette labels follow the VS Code display language (English / 简体中文).
36
+
37
+ ## Commands & Usage
38
+
39
+ ### Command Palette (`Ctrl+Shift+P`)
40
+
41
+ | Command | Description |
42
+ |---------|-------------|
43
+ | `Show Preview` (`Ctrl+Alt+V`) | Open or focus the preview panel |
44
+ | `Show Slides Preview` (`Ctrl+Alt+S`) | Open the slide preview |
45
+ | `ColaView MD: Present: Document Fullscreen` | Present the document fullscreen |
46
+ | `ColaView MD: Present: Slides Fullscreen` | Present the slides fullscreen |
47
+ | `ColaView MD: Export to PDF...` | Export current file as A4 PDF |
48
+ | `ColaView MD: Export to HTML...` | Export as standalone HTML |
49
+ | `ColaView MD: Export to Word...` | Export current file as `.docx` Word document |
50
+ | `ColaView MD: Export Slides to PDF...` | Export slides as 1920×1080 PDF |
51
+ | `ColaView MD: Export Slides to HTML...` | Export slides as standalone `.slides.html` |
52
+ | `ColaView MD: Export to PPTX...` | Export slides as native PowerPoint |
53
+ | `ColaView MD: Switch Preview Theme...` | Choose from 12 built-in + custom themes |
54
+ | `ColaView MD: Import Custom Theme...` | Load a `.css` file as custom theme |
55
+
56
+ ### Right-click Context Menu (in Preview)
57
+
58
+ When the preview is open, right-click anywhere to access (**Present (Fullscreen)** is always first):
59
+
60
+ | Document mode | Slides mode |
61
+ |---------------|-------------|
62
+ | **Present (Fullscreen)** | **Present (Fullscreen)** |
63
+ | Export to PDF | Export to PDF |
64
+ | Export to HTML | Export to PPTX |
65
+ | Export to Word | Theme ▸ |
66
+ | Theme ▸ | Import Theme… |
67
+ | Import Theme… | |
68
+
69
+ The Theme ▸ submenu is grouped into Built-in · Light / Built-in · Dark / Custom and scrolls when long.
70
+
71
+ ## Themes
72
+
73
+ ### Built-in Themes
74
+
75
+ | Theme | Style | Best For |
76
+ |-------|-------|----------|
77
+ | **Light** | Clean white, blue accents | General use, documentation |
78
+ | **Dark** | GitHub Dark palette | Night coding |
79
+ | **Elegant** | Warm serif, beige tones | Academic papers, long-form |
80
+ | **Sepia** | Warm sepia, paper texture | Extended reading, low-eye-strain |
81
+ | **Notion** | Not.so MCP | Notion-like clean minimalism |
82
+ | **Bear** | Bear.app style | Note-taking, casual writing |
83
+ | **Writer** | Monospace-friendly | Technical writing, code-heavy docs |
84
+ | **Solarized Dark** | Ethan Schoonover palette | Low-contrast dark coding |
85
+ | **Nord** | Arctic blue palette | Calm, focused writing |
86
+ | **Gruvbox** | Retro 80s terminal | Nostalgia, high-contrast |
87
+ | **Dracula** | Zeno Rocha palette | Vibrant dark theme |
88
+ | **Midnight** | Deep navy, gold accents | Night writing, premium feel |
89
+
90
+ ### Custom Themes
91
+
92
+ Place `.css` files in the `.themes/` directory at your workspace root. Two custom themes are bundled with the extension:
93
+
94
+ | Theme | Style | Best For |
95
+ |-------|-------|----------|
96
+ | **Academic Paper** | GB/T 7713 standard, serif body, three-line tables, black-on-white | Academic papers, formal documents, printing |
97
+ | **Trae Blue** | Trae IDE documentation style, white + Slate gray, blue accents | Technical docs, modern documentation |
98
+
99
+ ```
100
+ my-project/
101
+ ├── .themes/
102
+ │ ├── my-dark.css # appears as "My-dark" in theme menu
103
+ │ └── corporate.css # appears as "Corporate" in theme menu
104
+ └── README.md
105
+ ```
106
+
107
+ Custom themes are automatically detected and appear alongside built-in themes in both the command palette and right-click context menu.
108
+
109
+ Switch via command palette or settings:
110
+
111
+ ```json
112
+ { "colaview.theme": "nord" }
113
+ ```
114
+
115
+ Import custom CSS: `Ctrl+Shift+P` → "ColaView MD: Import Custom Theme..." or via right-click menu → "Import Theme..."
116
+
117
+ ## Configuration
118
+
119
+ | Setting | Type | Default | Description |
120
+ |---------|------|---------|-------------|
121
+ | `colaview.theme` | `string` | `"elegant"` | Preview theme: `light`, `dark`, `elegant`, `sepia`, `notion`, `bear`, `writer`, `solarized-dark`, `nord`, `gruvbox`, `dracula`, `midnight`, or any custom theme name |
122
+ | `colaview.autoPreview` | `boolean` | `false` | Auto-open preview for `.md` files |
123
+ | `colaview.scrollSync` | `boolean` | `false` | **Experimental** — Enable scroll sync between editor and preview |
124
+
125
+ ## Supported Syntax
126
+
127
+ **Standard Markdown** — Headings, bold, italic, strikethrough, code blocks, links, images, lists, blockquotes
128
+
129
+ **GFM Extensions** — Tables, task lists, footnotes, autolinks
130
+
131
+ **Math (KaTeX)**
132
+
133
+ ```markdown
134
+ Inline: $E = mc^2$
135
+
136
+ Display:
137
+ $$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$
138
+ ```
139
+
140
+ **Diagrams (Mermaid)**
141
+
142
+ ````markdown
143
+ ```mermaid
144
+ graph LR
145
+ A[Markdown] --> B[ColaView]
146
+ B --> C[PDF]
147
+ B --> D[HTML]
148
+ ```
149
+ ````
150
+
151
+ Supports: flowchart, sequence, class, state, ER, journey, pie, Gantt, gitGraph, mindmap, timeline, quadrant, XY, C4, Sankey, block, architecture
152
+
153
+ ## Architecture
154
+
155
+ ```
156
+ ┌─────────────┐ postMessage ┌──────────────────┐
157
+ │ Extension │ ◄──────────────────► │ WebView │
158
+ │ (Node.js) │ │ (CodeMirror 6/ │
159
+ │ │ raw markdown ──► │ ColaMD renderer)│
160
+ │ ThemeManager│ theme/css ──► │ │
161
+ │ Exporters │ ◄── complete HTML │ Read-only rich │
162
+ │ │ │ preview + Menu │
163
+ └─────────────┘ └──────────────────┘
164
+ ```
165
+
166
+ **Key design:** The extension sends raw Markdown to the WebView, where ColaMD (CodeMirror 6 based) renders it as a read-only rich preview. The source buffer is the single source of truth — no serialization loss on export. For exports, the WebView asynchronously builds a complete standalone HTML (including KaTeX fonts, Mermaid SVGs, and theme CSS) and returns it to the extension.
167
+
168
+ ### Security Model
169
+
170
+ The WebView uses a strict Content-Security-Policy (CSP):
171
+
172
+ 1. `style-src 'unsafe-inline'` is required for CodeMirror 6's dynamic styling and KaTeX's inline fonts
173
+ 2. `script-src 'unsafe-inline'` is required for esbuild's IIFE bundle format
174
+ 3. All resource URIs are resolved through `webview.asWebviewUri()` for sandbox isolation
175
+ 4. This prevents XSS injection even if markdown content contains malicious scripts
176
+
177
+ ### Project Structure
178
+
179
+ ```
180
+ src/
181
+ ├── extension.ts # Entry point (activate/deactivate), error isolation
182
+ ├── commands/commands.ts # Command registration (showPreview, exportHTML, exportPDF, etc.)
183
+ ├── preview/
184
+ │ ├── preview-manager.ts # WebView lifecycle, message handling, debounce sync
185
+ │ └── webview/
186
+ │ ├── index.html # WebView template + context menu styles
187
+ │ └── app.ts # ColaMD (CM6) init + context menu + scroll sync
188
+ ├── export/
189
+ │ ├── pdf-exporter.ts # Puppeteer PDF generation (A4, print background)
190
+ │ ├── html-exporter.ts # Standalone HTML export (embedded CSS)
191
+ │ ├── docx-exporter.ts # Word (.docx) export via docx + remark-parse/remark-gfm
192
+ │ ├── render-export-images.ts # KaTeX/Mermaid → PNG (headless Chrome) for Word export
193
+ │ └── theme-style.ts # Theme CSS → semantic HTML style converter for exports
194
+ ├── themes/
195
+ │ ├── theme-manager.ts # Theme loading, switching, .themes/ directory scanning, import
196
+ │ ├── foundation.css # Base CSS variables (colors, spacing)
197
+ │ └── built-in/ # 12 built-in themes (light.css, dark.css, elegant.css, sepia.css, ...)
198
+ └── types/
199
+ └── colamd-renderer.d.ts # Local type declarations for ColaMD 2.7.9 npm package
200
+ ```
201
+
202
+ ## Development
203
+
204
+ ```bash
205
+ git clone https://github.com/bytechain/vscode-colaview.git
206
+ cd vscode-colaview
207
+ npm install
208
+
209
+ # Build (esbuild bundles all deps into out/)
210
+ npm run build
211
+
212
+ # Watch mode
213
+ npm run watch
214
+
215
+ # Package .vsix
216
+ npm run package
217
+
218
+ # Debug: press F5 in VS Code to launch Extension Development Host
219
+ ```
220
+
221
+ ### Build System
222
+
223
+ The project uses **esbuild** for bundling — the extension side (`out/extension.js`) is a small CJS bundle with only VS Code API imports. The WebView side (`out/preview/webview/app.js`) is an IIFE bundle containing the full ColaMD 2.8.2 rendering engine (CodeMirror 6 + Mermaid + KaTeX) — approximately 3.5MB unminified, gzip ~400KB. Resource files (CSS, WebView HTML, KaTeX stylesheet, Mermaid script) are copied to `out/` during build so they survive `.vscodeignore` packaging.
224
+
225
+ ## Changelog
226
+
227
+ ### v0.4.1 (Current)
228
+
229
+ - **🎬 Slide Mermaid & Math Rendered** — mermaid fences are no longer split into invalid chunks ("Syntax error in text") and, together with `$$…$$` blocks, are hydrated with mermaid SVG / KaTeX in the preview (source shown as fallback); WebView bundle grows to ~11MB.
230
+ - **🐛 Present (Fullscreen) Opens the Browser Reliably** — Windows `file:` URI via `openExternal` failed ("系统找不到指定的文件"); presenting now uses the platform shell (`start` / `open` / `xdg-open`) with `openExternal` as fallback.
231
+ - **🖼️ Present Window & Slides PDF Include Mermaid** — standalone slide documents embed a CDN hydration script (mermaid + KaTeX); the slides PDF exporter waits for hydration before printing. Offline, the source stays as fallback.
232
+ - **🎯 Slide Rendering Aligned with DSH / ColaMD-extend** — slides mermaid renders through **pele** (the same renderer as ColaMD-extend) with `--pele-*` theme tokens instead of mermaid themes; per-page fit switched from `zoom` to font-size shrink (DSH `fitPaper`), re-run after hydration and before slides-PDF printing; blank directive-only pages are filtered during pagination.
233
+
234
+ ### v0.4.0
235
+
236
+ - **🔧 Engine Upgrade — ColaMD 2.8.2, No More Patches** — the CM6 whole-line replace-decoration fix (`block: true`, previously a `patch-package` patch) is now native to the engine and extended to tables and HTML blocks; the `patches/` directory is gone. The engine's mermaid palette is page-based as well.
237
+ - **🎨 Mermaid Diagrams Drawn on the Page** — preview and HTML/PDF exports derive the `--pele-*` tokens from page colors (`--bg-color`/`--text-color`, 18%/28%/45% mixes) instead of code-block colors, and no longer paint a code-block background behind diagrams — matching ColaMD-extend. Most visible with Elegant/Bear, which previously drew pale lines on the dark code block.
238
+ - **🐛 Theme Variables Actually Apply Now** — the engine's `body.theme-x` variables (specificity 0,1,1) always beat the injected `:root` (0,1,0), so theme-file variable values were ignored in the preview. Theme CSS is now injected as `:root, body.theme-x`; exports apply the same scoping.
239
+ - **🎨 All 12 Built-in Themes Synced with ColaMD-extend** — border colors refined in every theme; Dark/Midnight/Writer add strong/inline-code accents; Notion swaps link underlines for strong/URL colors; blockquote overrides trimmed; Elegant drops the dead `--table-border` variable.
240
+ - **🎨 Word Export: Readable Colors on White Paper** — dark themes fall back entirely to the light palette; light themes with a dark code block (Elegant/Bear) draw diagrams on white with body-text color.
241
+ - **🧭 Menus Simplified, Theme Submenu Grouped** — editor context menu reduced to Show Preview / Show Slides Preview; the preview menu keeps Present (fullscreen) first and scopes exports by mode (documents: PDF/HTML/Word, slides: PDF/PPTX); the theme submenu groups into Built-in · Light / Dark / Custom with a scrollable max-height.
242
+ - **🎯 Rendering Aligned with the DSH Plugin** — 12 themes upgraded to the ColaMD 2.8 contract (seed palette, typography tokens, JetBrains Mono/Fira Code webfont mirroring); the WebView injects the DSH BASE_CSS layer (820px column, 1.78 line-height, 0.01em letter-spacing, token heading metrics) beneath theme identity rules.
243
+ - **🐛 Slides Theme Switch Fixed** — a workspace `colaview.theme` value shadowed the user setting, so slides decks recomposed from the stale theme after switching; theme writes now target the active settings scope and switches pass the theme name explicitly.
244
+
245
+ ### v0.3.4
246
+
247
+ - **🎬 Slide Preview & Presenting** — a dedicated render layer (`src/slides/`) reuses the upstream `slides.css` line contract, splits pages by `<!-- slide: cover -->`-style directives at 1920×1080, and switches modes inside the preview panel.
248
+ - **🖥️ Fullscreen Presenting** — documents and slides are handed to the system browser (`src/present/`): ←/→ paging, `F` to toggle fullscreen, click either half to navigate.
249
+ - **📤 Slide Exports** — PDF (1920×1080 per page), standalone `.slides.html` with paging/fullscreen, and PPTX (16:9, zero-dependency OOXML).
250
+ - **🌐 Localized Preview Menu** — context-menu labels follow `vscode.env.language`; **Present (Fullscreen)** is pinned first and export entries follow the document/slides mode (Word for documents, PPTX for slides).
251
+
252
+ ### v0.3.2
253
+
254
+ - **🐛 PDF/HTML Export Fixed (`md is not defined`)** — exporting failed with "PDF export failed: md is not defined": a CSS comment inside the export stylesheet template literal contained unescaped backticks, which closed the literal early and made the parser treat part of the comment as JavaScript. Backticks are now escaped.
255
+ - **🐛 PDF/HTML Mermaid Diagrams Centered** — the engine serializes mermaid blocks as class-stripped `<p><svg class="pele pele-…">…</svg></p>`, so the previous `div:has(> svg.pele)` export rule never matched and diagrams were left-aligned on paper. Centering now applies to `svg.pele` itself (`display: block; margin: 0 auto`), independent of the wrapper element.
256
+ - **🎨 Mermaid Diagram Background Matches ColaMD-extend** — diagrams are now drawn on the code-block background (`--code-block-bg`, 6px radius, `0.8em 1em` padding) in both the preview and HTML/PDF exports, matching ColaMD instead of floating on the plain page background (most visible with Elegant/Bear, whose dark code blocks sit on light pages).
257
+ - **🎨 Mermaid Colors Match the Preview in Every Theme** — non-Elegant themes exported diagrams with different node/edge/label colors because the export re-declared `--pele-*` on a `div:has(> svg.pele)` selector that never matched the serialized `<p><svg class="pele">` markup, leaving pele's built-in palette in effect. Exports now use the runtime values collected from the preview into `:root`, with the derived token block injected only when those values are absent.
258
+ - **🧹 Removed Ineffective Settings** — `colaview.plugins.math` / `colaview.plugins.mermaid` (no-ops since v0.3.0) and `colaview.pdfMethod` / `colaview.customThemesPath` (never read) are gone; remaining settings: `colaview.theme`, `colaview.autoPreview`, `colaview.scrollSync`.
259
+ - **🐛 Preview Blocks No Longer Vanish After Source View** — Fixed an engine bug (multi-line inline replace decorations are ignored by CodeMirror 6 on incremental updates): clicking a mermaid diagram / multi-line block formula to view its source, then clicking away, no longer makes the whole block disappear. Patched via `patch-package`; fix also applied upstream in ColaMD-extend.
260
+ - **🐛 Word Export Images Fixed** — puppeteer v25 screenshot returns `Uint8Array`; the previous base64 conversion produced corrupt data so formulas/diagrams appeared as placeholder text in the `.docx`. Now converted with `Buffer.from()`.
261
+ - **🐛 Word Formula Glyphs Fixed** — KaTeX fonts are inlined as base64 into the screenshot page (the relative `fonts/*.woff2` URLs could not resolve), so formulas render with proper KaTeX fonts.
262
+ - **🎨 Exports Match Preview Colors** — The engine's theme-scoped body rules (bold/inline-code/heading accent colors per theme) are translated to semantic selectors and injected into HTML/PDF exports for all 12 themes.
263
+
264
+ ### v0.3.1
265
+
266
+ - **🔧 Engine Upgrade — ColaMD 2.7.11** — Inline math in table cells, CSS-driven list indent, block widget layout fixes, official CM6 typing commands.
267
+ - **🎨 Word Mermaid Diagrams Follow Theme** — Diagram colors derived from the current preview theme's tokens (dark themes fall back to light), instead of mermaid's hardcoded `neutral`.
268
+ - **🐛 Windows Word Code Blocks Fixed** — Platform mono font in all four `w:rFonts` slots + CJK `eastAsia` font, explicit left alignment, light border, `noProof` (port of ColaMD-extend #202).
269
+ - **🐛 Inline Formulas No Longer Wrap** — Wider (2000px) measurement viewport before capture.
270
+ - **🐛 HTML/PDF Diagrams Follow Theme + No Zoom Controls** — Export CSS matches serialized pele SVG wrappers to restore `--pele-*` variables; editor-only zoom controls hidden on paper.
271
+
272
+ ### v0.3.0
273
+
274
+ - **📝 Word Export (`.docx`)** — Ported from ColaMD-extend. High-fidelity Word export with headings, paragraphs, inline styles, code blocks, lists, tables, blockquotes, horizontal rules, images, footnotes, and rasterized KaTeX/Mermaid diagrams.
275
+ - **🎨 Theme-Faithful Export** — New `theme-style.ts` conversion layer maps editor-only theme selectors (`#editor .cm-content .cm-md-*`) to semantic HTML selectors, so PDF/HTML/Word exports inherit the current preview theme's fonts, accent colors, table header styling and blockquote padding.
276
+ - **🐛 PDF Blank Export Fixed** — Stripped ColaMD's Electron `@media print` rule that hid the exported `<article>` element, so PDF (and HTML) export no longer renders blank.
277
+ - **🐛 HTML Export Theme Fix** — Fixed exported HTML not applying preview theme styles due to the editor-only selector mismatch.
278
+ - **📦 New Dependencies** — `docx`, `katex`, `remark-parse`, `remark-gfm`, `unified`.
279
+ - **🔧 Engine Upgrade — ColaMD 2.7.9 (CodeMirror 6)** — Migrated from Milkdown/ProseMirror to CodeMirror 6. Source buffer is now the single source of truth with zero serialization loss on export.
280
+ - **🎨 12 Built-in Themes** — Expanded from 4 to 12 themes: Light, Dark, Elegant, Sepia, Notion, Bear, Writer, Solarized Dark, Nord, Gruvbox, Dracula, Midnight. Default theme changed to Elegant.
281
+ - **📤 Async HTML Export** — `buildExportHTML()` is now asynchronous, automatically waits for Mermaid diagrams and KaTeX fonts to render before producing the final HTML.
282
+ - **🗑️ Removed Plugin Toggle** — Math and Mermaid are now integral to the ColaMD engine; `colaview.plugins.math` and `colaview.plugins.mermaid` settings are no longer functional.
283
+ - **📰 Removed Newsprint Theme** — Newsprint is not available in ColaMD 2.7.9.
284
+ - **🔄 DOM Structure Changed** — The preview container uses `.cm-editor` / `.cm-scroller` / `.cm-content` instead of `.ProseMirror`. Scroll sync target updated to `.cm-scroller`.
285
+ - **📦 Dependency Bump** — `@bytechain.cn/colamd` upgraded from `^1.5.2` to `^2.7.9`. TypeScript type declarations added locally since 2.7.9 npm package does not publish `.d.ts` files.
286
+ - **🖼️ KaTeX Fonts Inlined** — KaTeX fonts are base64-encoded inside `colamd.css`, no additional resource paths needed for PDF export.
287
+
288
+ ### v0.2.0
289
+
290
+ - **🏗️ Architecture Overhaul** — Error-isolated activation, refactored PreviewManager, runtime plugin toggle sync for math/mermaid settings
291
+ - **🖱️ Right-Click Context Menu** — Export HTML/PDF, switch theme (with submenu), import custom theme — directly in the preview panel
292
+ - **🎨 New Custom Themes** — Academic Paper (GB/T 7713 standard) and Trae Blue (Trae IDE documentation style)
293
+ - **🧹 Cleanup** — Removed obsolete files (`debug-load.js`, `configuration.ts`, `file-utils.ts`)
294
+ - **🐛 Fixes** — h4 color consistency, code block border color, print margin width
295
+
296
+ ### v0.1.3
297
+
298
+ - **🔄 Experimental Scroll Sync** — Bidirectional scroll synchronization between editor and preview panel. Enable via `colaview.scrollSync` setting.
299
+ - Enhanced error handling in extension activation and preview manager initialization
300
+
301
+ ### v0.1.2
302
+
303
+ - **🐛 Blockquote Background Fix** — Fixed blockquote background color being overridden by page background in Dark, Light, and Newsprint themes
304
+
305
+ ### v0.1.1
306
+
307
+ - **🎨 Theme Consistency Fix** — Unified `--code-color` and `--code-block-text` CSS variables across all 4 built-in themes (Light, Dark, Elegant, Newsprint), eliminating inconsistent inline code / code block text colors
308
+ - **📰 Newsprint Theme Alignment** — Fully aligned Newsprint theme variables with [ColaMD-extend](https://github.com/byteuser1977/ColaMD-extend) base.css, including font family (PT Serif serif stack), code color inheritance, and all semantic color tokens
309
+ - **🔧 Light Theme Completion** — Added missing `--table-border` variable to Light theme for consistent table styling
310
+ - **📦 Dependency Migration** — Switched from local ColaMD project reference to npm package `@bytechain.cn/colamd` (^1.5.2)
311
+
312
+ ### v0.1.0
313
+
314
+ - Initial release with WYSIWYG preview, PDF/HTML export, 4 built-in themes, custom theme support
315
+
316
+ ## License
317
+
318
+ [MIT](LICENSE)