vscode-colaview 0.4.1 → 0.4.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.4.3] - 2026-12-05
6
+
7
+ ### Fixed
8
+ - **Slide styling now matches the reference deck** — theme slide rules were not applied by the slide renderer, so cover and section titles fell back to white body text at the wrong size and the agenda, KPI, quote and matrix layouts lost their type scale and accent colors. Preview, fullscreen presenting and slide PDF now render the themed deck as designed.
9
+ - **Same layout in fullscreen and on paper** — the fixed 1920×1080 paper calibration (page padding, top padding, kicker size) now also applies to fullscreen presenting, so paging, preview and the exported PDF share one layout.
10
+
11
+ ### Changed
12
+ - **`pink-script-dark` now ships unmodified** — the bundled theme is byte-identical to the ColaMD-themes source file.
13
+
14
+ ## [0.4.2] - 2026-12-05
15
+
16
+ ### Added
17
+ - **Local relative images** — images referenced by a path relative to the document (for example `![](./images/example.png)`) now display correctly in the document preview, slide deck, fullscreen presenting and HTML/PDF exports. Previously the preview could fall back to showing the raw Markdown source.
18
+
19
+ ### Changed
20
+ - **Consistent slide layout across preview, presenting and PDF** — all three now share the same 1920×1080 paper layout and typography. Cover and closing pages are vertically centred, ordinary pages stay top-aligned, and each `---` separator produces exactly one slide; content that exceeds a page is scaled down as a whole rather than being split into extra pages.
21
+ - **Cleaner slide output** — presented and exported slides no longer include a generated brand header or page-number footer, so only the Markdown content is shown. Quote blocks no longer display an extra `>` marker, and long titles keep their intended size.
22
+ - **Updated custom theme** — the `pink-script-dark` theme uses a serif face for quote text, matching the reference design.
23
+
24
+ ### Docs
25
+ - **README refresh** — Chinese/English switch, theme preview gallery, Marketplace and VSIX installation steps, a quick-start guide, custom-theme guidance and consolidated release-note links.
26
+
5
27
  ## [0.4.1] - 2026-12-03
6
28
 
7
29
  ### Added
@@ -12,7 +34,7 @@ All notable changes to this project will be documented in this file.
12
34
 
13
35
  ### Fixed
14
36
  - **Slides preview showed mermaid blocks as source code / "Syntax error in text"** — two causes: the deck paginator split oversized ```mermaid fences by line budget, producing invalid partial sources that failed mermaid parsing (mermaid blocks are now kept whole, occupying a page on their own when oversized); and the placeholder containers were invisible until hydration (fixed by the hydration above). `$$…$$` block math is likewise rendered instead of shown raw.
15
- - **Fullscreen presenting failed with "系统找不到指定的文件"** — `vscode.env.openExternal` with a `file:` URI goes through ShellExecute and fails on Windows. Presenting now opens the default browser via the platform shell (`start` on Windows, `open` on macOS, `xdg-open` on Linux), with `openExternal` kept as fallback.
37
+ - **Fullscreen presenting failed on Windows** — opening a temporary `file:` link through the system shell could fail with a "file not found" error. Presenting now opens the default browser through the platform command (`start` on Windows, `open` on macOS, `xdg-open` on Linux), with `openExternal` kept as fallback.
16
38
  - **Present mode / slides PDF export had no mermaid content at all** — the standalone documents now carry a CDN hydration script (mermaid + KaTeX); the PDF exporter waits for hydration (`window.__colaviewSlidesHydrated`) before printing. Offline, the source stays visible as fallback.
17
39
 
18
40
  ## [0.4.0] - 2026-12-01
@@ -39,10 +61,10 @@ All notable changes to this project will be documented in this file.
39
61
  ## [0.3.4] - 2026-12-01
40
62
 
41
63
  ### Added
42
- - **幻灯片预览与放映(合入 0.2.x 分支的能力,适配 0.4.0 的 CodeMirror 6 预览层)** — 复用上游 `slides.css` 行级契约的独立渲染层(`src/slides/`),按 `<!-- slide: cover -->` 等指令分页,每页固定 1920×1080;预览面板内可在文档/幻灯片两种模式间切换。
43
- - **全屏放映** — 文档与幻灯片都交给系统浏览器放映(`src/present/`):幻灯片 ←/→ 翻页、`F` 切换全屏、点击左右半屏翻页。
44
- - **幻灯片导出** — PDF(每页 1920×1080)、独立 HTML(`.slides.html`,自带翻页与全屏)、PPTX(16:9,零依赖 OOXML)。
45
- - **中英双语的预览菜单** — 右键菜单文案由扩展宿主按 `vscode.env.language` 下发;「全屏显示」固定置顶,导出项按文档/幻灯片模式区分(文档给 Word,幻灯片给 PPTX)。
64
+ - **Slide preview and presenting** — a dedicated slide layer with fixed 1920×1080 pages, paginated by `<!-- slide: cover -->`-style directives and switchable from the preview panel.
65
+ - **Fullscreen presenting** — documents and slides open in the system browser; slides support ←/→ paging, `F` for fullscreen and clicking either half of the screen to navigate.
66
+ - **Slide exports** — PDF (one 1920×1080 page per slide), standalone `.slides.html` with paging and fullscreen, and PPTX (16:9, zero-dependency OOXML).
67
+ - **Bilingual preview menus** — context-menu labels follow the VS Code display language; "Present (Fullscreen)" stays pinned first and export formats are scoped to the current mode (Word for documents, PPTX for slides).
46
68
 
47
69
 
48
70
  ## [0.3.2] - 2026-11-07
package/README.md CHANGED
@@ -1,16 +1,51 @@
1
1
  # ColaView MD
2
2
 
3
+ <p align="right"><a href="README.md">English</a> | <a href="README_CN.md">中文</a></p>
4
+
3
5
  [![VS Code](https://img.shields.io/badge/VS_Code-1.85%2B-007ACC?logo=visual-studio-code)](https://code.visualstudio.com/)
4
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-3178C6?logo=typescript)](https://www.typescriptlang.org/)
5
7
  [![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
6
- [![Version](https://img.shields.io/badge/Version-0.4.1-orange)](package.json)
8
+ [![Version](https://img.shields.io/badge/Version-0.4.3-orange)](package.json)
9
+ [![GitHub stars](https://img.shields.io/github/stars/byteuser1977/vscode-colaview?style=flat&logo=github)](https://github.com/byteuser1977/vscode-colaview/stargazers)
10
+ [![Marketplace](https://img.shields.io/visual-studio-marketplace/v/bytechain.vscode-colaview?style=flat&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=bytechain.vscode-colaview)
11
+
12
+ > Rich Markdown preview · slide presenting · **HTML / A4 PDF / 16:9 slide PDF / Word / PPTX** export — one theme across preview and paper.
13
+
14
+ Rich Markdown preview & export for VS Code — powered by the [ColaMD](https://github.com/byteuser1977/ColaMD-extend) rendering engine (CodeMirror 6), kept in sync with the [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes) theme and DSH rendering contracts.
15
+
16
+ **[Install](#install--first-use)** · [Gallery](#interface--theme-gallery) · [Features](#features) · [Commands](#commands--usage) · [Themes](#themes) · [License](#license)
17
+
18
+ ## Install & First Use
19
+
20
+ 1. **Install** — search **ColaView MD** (ID `bytechain.vscode-colaview`) in the VS Code Marketplace, or [install from the Marketplace page](https://marketplace.visualstudio.com/items?itemName=bytechain.vscode-colaview); a `.vsix` can be installed with `code --install-extension vscode-colaview-0.4.3.vsix`.
21
+ 2. **Open a document** — open any `.md` file in VS Code.
22
+ 3. **Open the preview** — press `Ctrl+Alt+V` (macOS `Cmd+Alt+V`) or run **“Markdown Preview”** from the Command Palette; `Ctrl+Alt+S` switches to the **slides preview**.
23
+ 4. **Pick a theme** — right-click inside the preview → **Theme**, grouped into Built-in · Light / Built-in · Dark / Custom; import any `.css` as a custom theme.
24
+ 5. **Export / present** — choose an export format from the context menu, or **Present (Fullscreen)** to hand the deck to your system browser (←/→ paging, `F` for fullscreen).
25
+
26
+ > UI language follows the VS Code display language — English UI shows English labels, 简体中文 UI shows Chinese labels; no separate setting needed.
27
+
28
+ If this extension helps you, please give the [GitHub repository](https://github.com/byteuser1977/vscode-colaview) a **Star**, or visit [colamd.com](https://colamd.com/) to explore the desktop editor.
29
+
30
+ ## Interface & Theme Gallery
7
31
 
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).
32
+ Every thumbnail below is a **real export** of the same document rendered with that theme's CSS — no mockups:
33
+
34
+ | | | | |
35
+ |:--:|:--:|:--:|:--:|
36
+ | <img src="assets/gallery/builtin-elegant.png" width="186" alt="elegant"><br><sub><code>Elegant</code></sub> | <img src="assets/gallery/builtin-dark.png" width="186" alt="dark"><br><sub><code>Dark</code></sub> | <img src="assets/gallery/builtin-sepia.png" width="186" alt="sepia"><br><sub><code>Sepia</code></sub> | <img src="assets/gallery/builtin-notion.png" width="186" alt="notion"><br><sub><code>Notion</code></sub> |
37
+
38
+ | | | | |
39
+ |:--:|:--:|:--:|:--:|
40
+ | <img src="assets/gallery/academic-paper.png" width="186" alt="academic-paper"><br><sub><code>Academic Paper</code></sub> | <img src="assets/gallery/forest-ink.png" width="186" alt="forest-ink"><br><sub><code>Forest Ink</code></sub> | <img src="assets/gallery/pink-script-dark.png" width="186" alt="pink-script-dark"><br><sub><code>Pink Script Dark</code></sub> | <img src="assets/gallery/swiss-design.png" width="186" alt="swiss-design"><br><sub><code>Swiss Design</code></sub> |
41
+
42
+ <sub>More themes live in [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes) (57 contract themes + 12 built-in themes); drop any `.css` into your workspace `.themes/` folder and it appears in the extension.</sub>
9
43
 
10
44
  ## Features
11
45
 
12
46
  - **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
47
+ - **Slide Preview & Presenting** — a separate render layer reusing the upstream `slides.css` line contract; pages map 1:1 to `---` at 1920×1080, with the eight viewport-derived tokens pinned to the 1920×1080 design space and the base type size taken from the theme's editor font, so paged preview, fullscreen presenting and slide PDF share one set of values. Fullscreen presenting supports ←/→ paging and `F` fullscreen for both documents and slides
48
+ - **Local Relative Images** — `![](./images/example.png)` resolves against the document's folder and renders consistently in the preview, slides, fullscreen presenting and HTML/PDF exports; relative paths no longer fall back to `![alt](path)` source text
14
49
  - **Math Formulas** — KaTeX integration for inline `$...$` and display `$$...$$` expressions (fonts inlined via base64)
15
50
  - **Mermaid Diagrams** — 17+ chart types: flowcharts, sequence, class, state, ER, Gantt, mind maps, etc.
16
51
  - **PDF Export** — Puppeteer headless Chrome renders A4 PDF with full theme styling (slides: one 1920×1080 page each)
@@ -25,14 +60,13 @@ Rich Markdown preview & PDF/HTML/Word export for VS Code — powered by [ColaMD]
25
60
  - **Live Sync** — 150ms debounced update while editing, experimental scroll sync between editor and preview
26
61
  - **Source Buffer Fidelity** — Raw Markdown bytes are preserved exactly; export uses the buffer content directly, no serialization loss
27
62
 
28
- ## Quick Start
63
+ ## Three-Step Start
29
64
 
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
65
+ 1. Open a `.md` file
66
+ 2. Press `Ctrl+Alt+V` for the preview (or `Ctrl+Shift+P` → **“Markdown Preview”**)
67
+ 3. Press `Ctrl+Alt+S` for the slides deck; right-click inside the preview to switch themes, export or present
34
68
 
35
- Menu and Command Palette labels follow the VS Code display language (English / 简体中文).
69
+ > Language switching: labels follow VS Code's display language (`Configure Display Language`); there is no separate extension setting.
36
70
 
37
71
  ## Commands & Usage
38
72
 
@@ -89,11 +123,14 @@ The Theme ▸ submenu is grouped into Built-in · Light / Built-in · Dark / Cus
89
123
 
90
124
  ### Custom Themes
91
125
 
92
- Place `.css` files in the `.themes/` directory at your workspace root. Two custom themes are bundled with the extension:
126
+ Place `.css` files in the `.themes/` directory at your workspace root and they are picked up automatically. The 57 contract themes from [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes) work as-is (copy any `.css` from its `themes/` folder). Examples:
93
127
 
94
128
  | Theme | Style | Best For |
95
129
  |-------|-------|----------|
96
130
  | **Academic Paper** | GB/T 7713 standard, serif body, three-line tables, black-on-white | Academic papers, formal documents, printing |
131
+ | **Forest Ink** | Deep greens, editorial-magazine mood | Nature, brand stories, long reads |
132
+ | **Pink Script Dark** | Dark canvas + pink script titles, magazine slides | Sharing, launches, creative decks |
133
+ | **Swiss Design** | Grid, whitespace, high-contrast sans system | Reports, products, data storytelling |
97
134
  | **Trae Blue** | Trae IDE documentation style, white + Slate gray, blue accents | Technical docs, modern documentation |
98
135
 
99
136
  ```
@@ -222,97 +259,20 @@ npm run package
222
259
 
223
260
  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
261
 
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
-
262
+ ## Contributing & Support
263
+
264
+ - **Star the repo** — [byteuser1977/vscode-colaview](https://github.com/byteuser1977/vscode-colaview) (use the Star button to follow updates)
265
+ - **Official site** — [colamd.com](https://colamd.com/); theme and export tooling lives in [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes)
266
+ - **Desktop editor** — [ColaMD-extend](https://github.com/byteuser1977/ColaMD-extend): the cross-platform Markdown editor sharing the same theme and rendering contracts
267
+ - **Feedback** — [Issues](https://github.com/byteuser1977/vscode-colaview/issues); themes, export styling and slide-layout suggestions are welcome
268
+
269
+ ## Version & Release Notes
270
+
271
+ - Current: **v0.4.3** — slide styling aligned with the reference deck across preview, presenting and PDF
272
+ - Full changelog: [CHANGELOG.md](CHANGELOG.md)
273
+ - Release highlights: [RELEASE_NOTES.md](RELEASE_NOTES.md)
274
+
316
275
  ## License
317
276
 
318
277
  [MIT](LICENSE)
278
+
package/README_CN.md CHANGED
@@ -1,16 +1,51 @@
1
1
  # ColaView MD
2
2
 
3
+ <p align="right"><a href="README.md">English</a> | <a href="README_CN.md">中文</a></p>
4
+
3
5
  [![VS Code](https://img.shields.io/badge/VS_Code-1.85%2B-007ACC?logo=visual-studio-code)](https://code.visualstudio.com/)
4
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-3178C6?logo=typescript)](https://www.typescriptlang.org/)
5
7
  [![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)
6
- [![Version](https://img.shields.io/badge/Version-0.4.1-orange)](package.json)
8
+ [![Version](https://img.shields.io/badge/Version-0.4.3-orange)](package.json)
9
+ [![GitHub stars](https://img.shields.io/github/stars/byteuser1977/vscode-colaview?style=flat&logo=github)](https://github.com/byteuser1977/vscode-colaview/stargazers)
10
+ [![Marketplace](https://img.shields.io/visual-studio-marketplace/v/bytechain.vscode-colaview?style=flat&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=bytechain.vscode-colaview)
11
+
12
+ > 富文本 Markdown 预览 · 幻灯片放映 · **HTML / A4 PDF / 16:9 幻灯片 PDF / Word / PPTX** 导出,一套主题贯穿预览与纸面。
13
+
14
+ VS Code 富文本 Markdown 预览与导出扩展 — 基于 [ColaMD](https://github.com/byteuser1977/ColaMD-extend) 渲染引擎(CodeMirror 6 内核),并与 [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes) 的主题与 DSH 渲染契约保持同步。
15
+
16
+ **[安装](#安装与首次使用)** · [界面与主题预览](#界面与主题预览) · [功能特性](#功能特性) · [命令与使用](#命令与使用方式) · [主题](#主题) · [License](#许可证)
17
+
18
+ ## 安装与首次使用
19
+
20
+ 1. **安装扩展** — 在 VS Code 扩展市场搜索 **ColaView MD**(ID `bytechain.vscode-colaview`),或[从市场页安装](https://marketplace.visualstudio.com/items?itemName=bytechain.vscode-colaview);也可下载 `.vsix` 后执行 `code --install-extension vscode-colaview-0.4.3.vsix`。
21
+ 2. **打开文档** — 在 VS Code 中打开任意 `.md` 文件。
22
+ 3. **打开预览** — 按 `Ctrl+Alt+V`(macOS `Cmd+Alt+V`),或命令面板运行 **「MD-预览」**;按 `Ctrl+Alt+S` 切换到 **幻灯片预览**。
23
+ 4. **换主题** — 预览面板内右键 → **主题**,按「内置 · 亮色 / 内置 · 暗色 / 自定义」分组选择;也可导入 `.css` 自定义主题。
24
+ 5. **导出 / 放映** — 右键菜单选择导出格式,或 **全屏显示** 交给系统浏览器放映(←/→ 翻页、`F` 全屏)。
25
+
26
+ > 菜单与命令文案跟随 VS Code 显示语言:界面为英文时显示 English,中文时显示简体中文,无需额外设置。
27
+
28
+ 如果这个扩展对你有帮助,欢迎在 [GitHub 仓库](https://github.com/byteuser1977/vscode-colaview) 点一个 **Star**,或访问 [ColaMD 官网](https://colamd.com/) 了解更多桌面端能力。
29
+
30
+ ## 界面与主题预览
7
31
 
8
- VS Code 富文本 Markdown 预览与 PDF/HTML/Word 导出扩展 — 基于 [ColaMD](https://github.com/byteuser1977/ColaMD-extend) 渲染引擎(CodeMirror 6 内核)。
32
+ 下面每张缩略图都是同一份文档经对应主题 CSS **真实导出**的结果(非效果图):
33
+
34
+ | | | | |
35
+ |:--:|:--:|:--:|:--:|
36
+ | <img src="assets/gallery/builtin-elegant.png" width="186" alt="elegant"><br><sub><code>Elegant</code></sub> | <img src="assets/gallery/builtin-dark.png" width="186" alt="dark"><br><sub><code>Dark</code></sub> | <img src="assets/gallery/builtin-sepia.png" width="186" alt="sepia"><br><sub><code>Sepia</code></sub> | <img src="assets/gallery/builtin-notion.png" width="186" alt="notion"><br><sub><code>Notion</code></sub> |
37
+
38
+ | | | | |
39
+ |:--:|:--:|:--:|:--:|
40
+ | <img src="assets/gallery/academic-paper.png" width="186" alt="academic-paper"><br><sub><code>Academic Paper</code></sub> | <img src="assets/gallery/forest-ink.png" width="186" alt="forest-ink"><br><sub><code>Forest Ink</code></sub> | <img src="assets/gallery/pink-script-dark.png" width="186" alt="pink-script-dark"><br><sub><code>Pink Script Dark</code></sub> | <img src="assets/gallery/swiss-design.png" width="186" alt="swiss-design"><br><sub><code>Swiss Design</code></sub> |
41
+
42
+ <sub>更多主题可在 [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes) 获取(57 套范式主题 + 12 套内置主题),把 `.css` 放进工作区 `.themes/` 即可在扩展中直接使用。</sub>
9
43
 
10
44
  ## 功能特性
11
45
 
12
46
  - **所见即所得预览** — CodeMirror 6 驱动的只读编辑器,实时渲染 Markdown 富文本。源码缓冲区是唯一真相,导出零序列化损耗
13
- - **幻灯片预览与放映** — 复用上游 `slides.css` 行级契约的独立渲染层,按 `<!-- slide: cover -->` 等指令分页、每页固定 1920×1080;文档与幻灯片都能全屏放映(←/→ 翻页、`F` 切换全屏)
47
+ - **幻灯片预览与放映** — 复用上游 `slides.css` 行级契约的独立渲染层,按 `<!-- slide: cover -->` 等指令分页、每页固定 1920×1080;页数与 `---` 一一对应,纸面 8 个视口令牌按 1920×1080 设计空间钉成 px,正文基准取主题编辑字号,与全屏放映、幻灯片 PDF 同一套数值。文档与幻灯片都能全屏放映(←/→ 翻页、`F` 切换全屏)
48
+ - **本地相对图片** — `![](./images/example.png)` 按文档所在目录解析,在本机预览、幻灯片、全屏放映与 HTML/PDF 导出中一致显示;相对路径不再回退成 `![alt](path)` 源码
14
49
  - **数学公式** — KaTeX 集成,支持行内 `$...$` 和块级 `$$...$$` 公式(字体通过 base64 内联)
15
50
  - **Mermaid 图表** — 17+ 种图表:流程图、时序图、类图、状态图、ER 图、甘特图、思维导图等
16
51
  - **PDF 导出** — Puppeteer 无头 Chrome 生成 A4 PDF,完整保留主题样式(幻灯片为每页 1920×1080)
@@ -25,14 +60,13 @@ VS Code 富文本 Markdown 预览与 PDF/HTML/Word 导出扩展 — 基于 [Cola
25
60
  - **实时同步** — 编辑后 150ms 防抖更新,实验性编辑器/预览滚动同步
26
61
  - **源码保真** — 原始 Markdown 字节原样保留;导出直接使用缓冲区内容,无序列化损耗
27
62
 
28
- ## 快速开始
63
+ ## 三步上手
29
64
 
30
- 1. 安装扩展
31
- 2. 在 VS Code 中打开 `.md` 文件
32
- 3. `Ctrl+Alt+V` 打开预览(或 `Ctrl+Shift+P` → **「预览」**)
33
- 4. 侧边栏打开富文本预览;`Ctrl+Alt+S` 切换到幻灯片预览
65
+ 1. 打开 `.md` 文件
66
+ 2. `Ctrl+Alt+V` 打开预览(或 `Ctrl+Shift+P` → **「MD-预览」**)
67
+ 3. `Ctrl+Alt+S` 切换到幻灯片预览;预览面板内右键可换主题、导出或全屏放映
34
68
 
35
- 菜单与命令面板文案跟随 VS Code 显示语言(English / 简体中文)。
69
+ > 中英文切换:界面语言跟随 VS Code 的显示语言(`Configure Display Language`),无需在扩展内单独设置。
36
70
 
37
71
  ## 命令与使用方式
38
72
 
@@ -89,11 +123,14 @@ Theme ▸ 子菜单按「内置 · 亮色 / 内置 · 暗色 / 自定义」分
89
123
 
90
124
  ### 自定义主题
91
125
 
92
- 在工作区根目录的 `.themes/` 目录下放置 `.css` 文件。扩展内置了 2 套自定义主题:
126
+ 在工作区根目录的 `.themes/` 目录下放置 `.css` 文件即可自动识别。可直接使用 [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes) 的 57 套范式主题(从仓库 `themes/` 复制 `.css` 到 `.themes/`),例如:
93
127
 
94
128
  | 主题 | 风格 | 适用场景 |
95
129
  |------|------|----------|
96
130
  | **Academic Paper(学术论文)** | GB/T 7713 标准,衬线正文,三线表,纯黑白 | 学术论文、正式文档、打印 |
131
+ | **Forest Ink(森林墨)** | 深浅绿意、编辑画册气质 | 自然、品牌与长文阅读 |
132
+ | **Pink Script Dark** | 深色底 + 粉色手写感标题,杂志风幻灯片 | 分享、发布会、创意演示 |
133
+ | **Swiss Design(瑞士国际主义)** | 网格、留白、强对比的无衬线体系 | 报告、产品与数据展示 |
97
134
  | **Trae Blue** | Trae IDE 文档风格,白底 slate 灰字,蓝色点缀 | 技术文档、现代文档编写 |
98
135
 
99
136
  ```
@@ -222,97 +259,20 @@ npm run package
222
259
 
223
260
  项目使用 **esbuild** 打包 — 扩展端(`out/extension.js`)是一个仅依赖 VS Code API 的小型 CJS bundle。WebView 端(`out/preview/webview/app.js`)是包含完整 ColaMD 2.8.2 渲染引擎(CodeMirror 6 + Mermaid + KaTeX)的 IIFE bundle — 未压缩约 3.5MB,gzip 后约 400KB。构建时自动复制资源文件(CSS、WebView HTML、KaTeX 样式表、Mermaid 脚本)到 `out/` 目录,确保打包安装后功能正常。
224
261
 
225
- ## 更新日志
226
-
227
- ### v0.4.1(当前版本)
228
-
229
- - **🎬 幻灯片渲染 mermaid 与公式** — mermaid 围栏不再被切成非法分段(修复「Syntax error in text」),与 `$$…$$` 公式块一起由 WebView 水合为 mermaid SVG / KaTeX HTML(渲染失败保留源码兜底);WebView 体积增至约 11MB。
230
- - **🐛 全屏放映可稳定打开浏览器** — Windows 上 `openExternal` 打开 `file:` URI 失败(「系统找不到指定的文件」);放映改走平台 shell(`start` / `open` / `xdg-open`),`openExternal` 作为兜底。
231
- - **🖼️ 放映窗口与幻灯片 PDF 包含 mermaid** — 独立幻灯片文档内嵌 CDN 水合脚本(mermaid + KaTeX);幻灯片 PDF 导出等待水合完成再打印。离线时保留源码兜底。
232
- - **🎯 幻灯片渲染对齐 DSH / ColaMD-extend** — 幻灯片 mermaid 改用 **pele** 渲染(与 ColaMD-extend 同一实现),配色走 `--pele-*` 主题令牌;逐页 fit 由 `zoom` 改为字号收缩(移植 DSH `fitPaper`),水合后与幻灯片 PDF 打印前重新 fit;分页过滤纯指令空页。
233
-
234
- ### v0.4.0
235
-
236
- - **🔧 引擎升级 — ColaMD 2.8.2,告别补丁** — CM6 整行 replace 装饰的 `block: true` 修复(此前靠 `patch-package` 固化)已随引擎原生发布,并扩展到表格与 HTML 块;`patches/` 目录已移除。引擎自身的 mermaid 配色也已页面化。
237
- - **🎨 Mermaid 图画在页面上** — 预览与 HTML/PDF 导出的 `--pele-*` 令牌改由页面颜色(`--bg-color`/`--text-color`,18%/28%/45% 混合)推导,不再按代码块配色、不再给图铺代码块底色,与 ColaMD-extend 一致。Elegant/Bear 此前把浅色线条画在深色代码块上,差异最明显。
238
- - **🐛 主题变量真正生效** — 引擎把同一批变量写在 `body.theme-x`(特异性 0,1,1)上,永远压过注入的 `:root`(0,1,0),主题文件里的变量值在预览中一直被忽略。主题 CSS 现以 `:root, body.theme-x` 注入;导出端同样处理。
239
- - **🎨 12 套内置主题与 ColaMD-extend 同步** — 全部主题边框色微调;Dark/Midnight/Writer 新增加粗/行内代码强调色;Notion 以 strong/URL 颜色替代链接下划线;引用块覆盖规则精简;Elegant 移除失效的 `--table-border` 变量。
240
- - **🎨 Word 导出:白纸上的可读配色** — 深色主题整体回落浅色板;浅色主题配深色代码块(Elegant/Bear)时图表以白底 + 正文色绘制。
241
- - **🧭 菜单精简,主题子菜单分组** — 代码页右键菜单只保留 Show Preview / Show Slides Preview;预览菜单「全屏显示」置顶,导出项按模式区分(文档:PDF/HTML/Word,幻灯片:PDF/PPTX);主题子菜单按「内置亮色 / 内置暗色 / 自定义」分组并限高滚动。
242
- - **🎯 对齐 DSH 插件渲染** — 12 套主题升级到 ColaMD 2.8 契约(seed 色板、排版令牌、JetBrains Mono/Fira Code webfont 镜像);WebView 注入 DSH BASE_CSS 对齐层(820px 列宽、1.78 行高、0.01em 字距、令牌化标题度量),层级位于主题个性规则之下。
243
- - **🐛 修复幻灯片模式切主题回退** — 工作区设置遮蔽了用户级 `colaview.theme`,切换后 deck 仍按旧主题合成;主题写入现在落到当前生效的设置层级,切换时显式传递主题名。
244
-
245
- ### v0.3.4
246
-
247
- - **🎬 幻灯片预览与放映** — 独立渲染层(`src/slides/`)复用上游 `slides.css` 行级契约,按 `<!-- slide: cover -->` 等指令分页、每页 1920×1080,预览面板内可直接切换文档/幻灯片模式
248
- - **🖥️ 全屏放映** — 文档与幻灯片交给系统浏览器(`src/present/`):←/→ 翻页、`F` 切换全屏、点击左右半屏翻页
249
- - **📤 幻灯片导出** — PDF(每页 1920×1080)、独立 `.slides.html`(自带翻页与全屏)、PPTX(16:9,零依赖 OOXML)
250
- - **🌐 预览菜单本地化** — 右键菜单文案随 `vscode.env.language` 下发;「全屏显示」置顶,导出项按文档/幻灯片模式区分(文档给 Word,幻灯片给 PPTX)
251
-
252
- ### v0.3.2
253
-
254
- - **🐛 修复 PDF/HTML 导出失败(`md is not defined`)** — 导出时报 "PDF export failed: md is not defined":导出样式模板字符串里的一段 CSS 注释含未转义的反引号,提前闭合了模板字面量,剩余注释被当成 JavaScript 解析。现已转义反引号,注释保持为注释。
255
- - **🐛 修复 PDF/HTML 导出中 Mermaid 图未居中** — 引擎把 mermaid 块序列化成不带类名的 `<p><svg class="pele pele-…">…</svg></p>`,此前的 `div:has(> svg.pele)` 导出规则匹配不到,居中在纸面上失效。现把居中规则落到 `svg.pele` 自身(`display: block; margin: 0 auto`),与父级是 `<p>` 还是 `<div>` 无关。
256
- - **🎨 Mermaid 图背景色与 ColaMD-extend 一致** — 图表配色按主题的代码块底色(`--code-block-bg`)推导,ColaMD 中图就画在这块底色上。预览与 HTML/PDF 导出现在同样给图加代码块底色(6px 圆角、`0.8em 1em` 内边距),不再浮在浅色页面上;Elegant/Bear(浅色页面配深色代码块)此前差异最明显。
257
- - **🎨 修复非 Elegant 主题导出后 Mermaid 图内配色与预览不一致** — 导出端此前在 `div:has(> svg.pele)` 上重新声明 `--pele-*`,而引擎序列化出来的是 `<p><svg class="pele">` 结构,选择器从不命中,图只能落回 pele 内置浅色配色(深色主题下节点/连线/文字明显偏色)。现改为直接使用 `buildExportHTML` 从预览 `.cm-md-mermaid` 收集进 `:root` 的运行时令牌;仅在确实缺失时才按引擎同一公式补一份兜底。
258
- - **🧹 移除无效配置项** — `colaview.plugins.math` / `colaview.plugins.mermaid`(自 v0.3.0 起无实际作用)与 `colaview.pdfMethod` / `colaview.customThemesPath`(从未被读取)已移除;保留 `colaview.theme`、`colaview.autoPreview`、`colaview.scrollSync`。
259
- - **🐛 修复预览中块级内容「看源码后消失」** — 引擎 bug(跨行 inline replace 装饰在 CM6 增量更新时不会被重建):点击 mermaid 图 / 多行块公式查看源码后再点走,整块内容不再消失。通过 `patch-package` 固化补丁,修复同步提交到 ColaMD-extend 上游。
260
- - **🐛 修复 Word 导出图片损坏** — puppeteer v25 截图返回 `Uint8Array`,此前的 base64 转换产出的是逗号十进制串,`.docx` 里公式/图表全部变成占位文本。现改用 `Buffer.from()` 转换。
261
- - **🐛 修复 Word 公式字形错乱** — KaTeX 字体以 base64 内联进截图页(相对 `fonts/*.woff2` 路径无法解析),公式以正确的 KaTeX 字体渲染。
262
- - **🎨 导出正文颜色与预览一致** — 引擎 colamd.css 中各主题的正文差异化规则(加粗/行内代码/标题配色)被翻译为语义化选择器并注入 HTML/PDF 导出,覆盖全部 12 套主题。
263
-
264
- ### v0.3.1
265
-
266
- - **🔧 引擎升级 — ColaMD 2.7.11** — 表格单元格内的行内公式成图、列表缩进纯 CSS 分派、块级 widget 布局修复、回车/退格回归 CM6 官方命令。
267
- - **🎨 Word 导出 Mermaid 配色跟随主题** — 图表配色从当前预览主题令牌推导(深色主题回落浅色),替代原来写死的 mermaid `neutral`。
268
- - **🐛 修复 Windows 下 Word 代码块乱码** — 等宽字体写入全部四个 `w:rFonts` 槽位 + 单独的 CJK `eastAsia` 中文字体、显式左对齐、浅色边框、`noProof`(移植 ColaMD-extend #202)。
269
- - **🐛 修复行内公式在 Word 导出中被折行** — 截图前测量视口加宽到 2000px。
270
- - **🐛 HTML/PDF 导出图表配色跟随主题 + 不再带缩放控件** — 导出 CSS 命中序列化后的 pele SVG 包裹结构恢复 `--pele-*` 变量映射;纸面上隐藏编辑器专属缩放控件。
271
-
272
- ### v0.3.0
273
-
274
- - **📝 Word 导出(`.docx`)** — 从 ColaMD-extend 移植。高保真 Word 导出,支持标题、段落、行内样式、代码块、列表、表格、引用块、水平线、图片、脚注,以及 KaTeX/Mermaid 转图。
275
- - **🎨 导出保留主题样式** — 新增 `theme-style.ts` 转换模块,将编辑器专属选择器(`#editor .cm-content .cm-md-*`)映射为语义化 HTML 选择器,PDF/HTML/Word 导出继承当前预览主题的字体、强调色、表格表头样式和引用块内边距。
276
- - **🐛 修复 PDF 导出空白** — 剥离 ColaMD 的 Electron `@media print` 规则(该规则会隐藏导出的 `<article>` 元素),PDF(和 HTML)导出不再空白。
277
- - **🐛 修复 HTML 导出主题样式失效** — 修复导出 HTML 因编辑器专属选择器无法匹配而丢失主题样式的问题。
278
- - **📦 新增依赖** — `docx`、`katex`、`remark-parse`、`remark-gfm`、`unified`。
279
- - **🔧 引擎升级 — ColaMD 2.7.9(CodeMirror 6)** — 从 Milkdown/ProseMirror 迁移到 CodeMirror 6。源码缓冲区成为唯一真相,导出零序列化损耗
280
- - **🎨 12 套内置主题** — 从 4 套扩展到 12 套:Light、Dark、Elegant、Sepia、Notion、Bear、Writer、Solarized Dark、Nord、Gruvbox、Dracula、Midnight。默认主题改为 Elegant
281
- - **📤 异步 HTML 导出** — `buildExportHTML()` 变为异步,自动等待 Mermaid 图表和 KaTeX 字体渲染完成后再产出最终 HTML
282
- - **🗑️ 移除插件开关** — 数学公式和 Mermaid 已内置于 ColaMD 引擎;`colaview.plugins.math` 和 `colaview.plugins.mermaid` 配置项不再生效
283
- - **📰 移除 Newsprint 主题** — Newsprint 在 ColaMD 2.7.9 中不存在
284
- - **🔄 DOM 结构变更** — 预览容器使用 `.cm-editor` / `.cm-scroller` / `.cm-content` 替代 `.ProseMirror`。滚动同步目标更新为 `.cm-scroller`
285
- - **📦 依赖升级** — `@bytechain.cn/colamd` 从 `^1.5.2` 升级到 `^2.7.9`。2.7.9 npm 包未发布 `.d.ts` 文件,本地补充类型声明
286
- - **🖼️ KaTeX 字体内联** — KaTeX 字体 base64 编码在 `colamd.css` 中,PDF 导出无需额外资源路径
287
-
288
- ### v0.2.0
289
-
290
- - **🏗️ 架构重构** — 激活流程错误隔离、PreviewManager 重构、math/mermaid 设置变更自动实时同步
291
- - **🖱️ 右键上下文菜单** — 预览面板内直接导出 HTML/PDF、切换主题(含子菜单)、导入自定义主题
292
- - **🎨 新增自定义主题** — 学术论文 Academic Paper(GB/T 7713 标准)和 Trae Blue(Trae IDE 文档风格)
293
- - **🧹 代码清理** — 移除废弃文件(`debug-load.js`、`configuration.ts`、`file-utils.ts`)
294
- - **🐛 问题修复** — h4 标题颜色一致性、代码块边框颜色、打印页边距宽度
295
-
296
- ### v0.1.3
297
-
298
- - **🔄 实验性滚动同步** — 编辑器与预览面板双向滚动同步。通过 `colaview.scrollSync` 设置启用。
299
- - 增强扩展激活和预览管理器初始化时的错误处理
300
-
301
- ### v0.1.2
302
-
303
- - **🐛 引用块背景色修复** — 修复 Dark、Light、Newsprint 主题下 blockquote 背景色被页面背景色覆盖的问题
304
-
305
- ### v0.1.1
306
-
307
- - **🎨 主题一致性修复** — 统一 4 套内置主题(Light、Dark、Elegant、Newsprint)的 `--code-color` 和 `--code-block-text` CSS 变量,解决行内代码与代码块字体颜色不一致的问题
308
- - **📰 Newsprint 主题对齐** — Newsprint 主题变量完全对齐 [ColaMD-extend](https://github.com/byteuser1977/ColaMD-extend) base.css,包括衬线字体(PT Serif 字体栈)、代码颜色继承及全部语义化颜色 token
309
- - **🔧 Light 主题补全** — 补充 Light 主题缺失的 `--table-border` 变量,确保表格样式一致
310
- - **📦 依赖迁移** — 从本地 ColaMD 项目引用切换为 npm 包 `@bytechain.cn/colamd` (^1.5.2)
311
-
312
- ### v0.1.0
313
-
314
- - 首次发布,包含所见即所得预览、PDF/HTML 导出、4 套内置主题、自定义主题支持
315
-
262
+ ## 参与与支持
263
+
264
+ - **Star 仓库** — [byteuser1977/vscode-colaview](https://github.com/byteuser1977/vscode-colaview)(右上角 Star,方便第一时间获取更新)
265
+ - **官方网站** — [colamd.com](https://colamd.com/);主题与导出工具链见 [ColaMD-themes](https://github.com/byteuser1977/ColaMD-themes)
266
+ - **桌面版** — [ColaMD-extend](https://github.com/byteuser1977/ColaMD-extend):同一套主题与渲染契约的跨平台 Markdown 编辑器
267
+ - **问题反馈** — [Issues](https://github.com/byteuser1977/vscode-colaview/issues);欢迎提交主题、导出样式与幻灯片版式的改进建议
268
+
269
+ ## 版本与更新记录
270
+
271
+ - 当前版本:**v0.4.3** — 预览 / 放映 / 导出统一套用主题幻灯片样式,与参照稿对齐
272
+ - 完整变更:[CHANGELOG.md](CHANGELOG.md)
273
+ - 版本亮点:[RELEASE_NOTES.md](RELEASE_NOTES.md)
274
+
316
275
  ## 许可证
317
276
 
318
277
  [MIT](LICENSE)
278
+
package/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Release Notes
2
2
 
3
+ ## v0.4.3 (2026-12-05)
4
+
5
+ ### 🎯 Slides Now Match the Reference Deck
6
+
7
+ Slide decks rendered in the preview, in fullscreen presenting and in the exported PDF were only partially themed: the cover and section titles appeared in white body text at the wrong size, while the agenda, KPI, quote and matrix pages lost their intended typography and accent colors.
8
+
9
+ The themed slide design is now applied everywhere, so:
10
+
11
+ - cover and section titles use the theme's display face and accent color;
12
+ - agenda, KPI, quote and matrix pages follow the reference type scale, hairlines and colors;
13
+ - preview, fullscreen presenting and slide PDF share one 1920×1080 layout, including page margins.
14
+
15
+ The bundled `pink-script-dark` theme now ships exactly as published in ColaMD-themes.
16
+
17
+ ## v0.4.2 (2026-12-05)
18
+
19
+ ### 🖼️ Local Images Now Render Everywhere
20
+
21
+ Markdown images that use a path relative to the document (for example `![example](./images/example.png)`) previously appeared as raw `![…](…)` text in the preview. Such images now display correctly in the document preview, slide deck, fullscreen presenting and HTML/PDF exports.
22
+
23
+ ### 🎯 Consistent Slide Layout Across Preview, Presenting and PDF
24
+
25
+ Paged preview, fullscreen presenting and slide PDF export now share the same 1920×1080 paper layout and typography:
26
+
27
+ - **Same typography everywhere** — preview, presenting and exported slides use one type scale, including cover and closing pages.
28
+ - **One slide per `---`** — each separator produces exactly one slide; content that does not fit is scaled down as a whole instead of being split into extra pages.
29
+ - **Refined layout** — cover and closing pages are vertically centred, while section and content pages stay top-aligned.
30
+
31
+ ### 🧹 Cleaner Slides
32
+
33
+ Slides no longer include a generated brand header or a page-number footer: preview, presenting and exports show only the Markdown content. Quote blocks no longer display an extra `>` marker, and long titles keep their intended size.
34
+
35
+ ### 🎨 Theme Update
36
+
37
+ The `pink-script-dark` theme now uses a serif face for quote text, matching the reference design.
38
+
39
+ ### 📖 README Refresh
40
+
41
+ The README now opens with a Chinese/English switch and a theme preview gallery, and adds Marketplace and VSIX installation steps, a quick-start walkthrough, custom-theme guidance and consolidated release-note links.
42
+
3
43
  ## v0.4.1 (2026-12-03)
4
44
 
5
45
  ### 🎬 Slides Preview: Mermaid & Math Now Render
@@ -15,7 +55,7 @@ Two fixes:
15
55
 
16
56
  Two presenting problems fixed:
17
57
 
18
- - **"系统找不到指定的文件"** — `vscode.env.openExternal` with a `file:` URI goes through Windows ShellExecute, which frequently cannot resolve file associations for that call. Presenting now opens the file through the platform shell — `start "" "<file>"` on Windows, `open` on macOS, `xdg-open` on Linux — with `openExternal` as a fallback and the file path in the error message if both fail.
58
+ - **"File not found" error on Windows** — opening a temporary `file:` link through the system shell could fail to resolve file associations. Presenting now opens the file through the platform command — `start "" "<file>"` on Windows, `open` on macOS, `xdg-open` on Linux — with `openExternal` as a fallback and the file path in the error message if both fail.
19
59
  - **No mermaid content in the present window / slides PDF** — the standalone documents now embed a CDN hydration script (mermaid + KaTeX) that fills the same placeholder containers, and the slides PDF exporter waits for hydration (`window.__colaviewSlidesHydrated`) before printing. Offline, the source stays visible as a fallback.
20
60
 
21
61
  ### 🎯 Slide Rendering Aligned with ColaMD-themes / ColaMD-extend
@@ -136,7 +176,7 @@ Clicking a rendered mermaid diagram or block formula reveals its source (per Col
136
176
 
137
177
  Two independent bugs made every formula/diagram image in the exported `.docx` broken:
138
178
 
139
- 1. **Corrupt image data** — puppeteer v25's `screenshot()` returns a `Uint8Array`; `Uint8Array.toString('base64')` ignores the argument and emits a comma-joined decimal byte string (`137,80,78,…`), which is not base64. The `.docx` image parser rejected it, so formulas/diagrams appeared as `[公式 1]` placeholder text. Screenshots are now converted with `Buffer.from()`.
179
+ 1. **Corrupt image data** — puppeteer v25's `screenshot()` returns a `Uint8Array`; `Uint8Array.toString('base64')` ignores the argument and emits a comma-joined decimal byte string (`137,80,78,…`), which is not base64. The `.docx` image parser rejected it, so formulas/diagrams appeared as `[Formula 1]` placeholder text. Screenshots are now converted with `Buffer.from()`.
140
180
  2. **Wrong glyph fonts** — the screenshot page inlines `katex.min.css`, but its relative `url(fonts/*.woff2)` references cannot resolve on a `page.setContent` page (about:blank base URL), so KaTeX fell back to system fonts. KaTeX fonts are now inlined as base64 data URIs at render time; the build also copies the font files to `out/assets/katex-fonts/` for packaged installs.
141
181
 
142
182
  ### 🎨 Exports Match the Preview's Theme Colors
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vscode-colaview",
3
3
  "displayName": "ColaView MD",
4
- "version": "0.4.1",
4
+ "version": "0.4.3",
5
5
  "publisher": "bytechain",
6
6
  "description": "ColaMD Preview — Rich Markdown Preview & PDF/HTML Export for VSCode",
7
7
  "icon": "icon.png",