Skip to content

Commit c9bcb4a

Browse files
committed
feat: add stream-markdown dependency and update documentation for MarkdownCodeBlockNode usage
1 parent 3d918c2 commit c9bcb4a

File tree

9 files changed

+294
-31
lines changed

9 files changed

+294
-31
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ yarn add mermaid stream-monaco shiki
173173
|----------------|---------|---------|---------------------|
174174
| `mermaid` | >=11 | Progressive Mermaid diagram rendering | Shows code block source |
175175
| `stream-monaco` | >=0.0.33 | Monaco Editor for interactive code editing | Plain text display |
176+
| `stream-markdown` | >=0.0.2 | Streaming renderer used by `MarkdownCodeBlockNode` | Plain text display |
176177
| `shiki` | ^3.13.0 | Syntax highlighting for `MarkdownCodeBlockNode` | Plain text display |
177178
| `vue-i18n` | >=9 | Internationalization support | Built-in fallback translator |
178179

@@ -793,6 +794,24 @@ The library now includes `MarkdownCodeBlockNode` - an alternative code block com
793794
- **CodeBlockNode** (default): Full-featured code blocks with Monaco Editor integration, copy buttons, expand/collapse, and advanced features
794795
- **MarkdownCodeBlockNode**: Lightweight markdown-style rendering with syntax highlighting using Shiki
795796
797+
Required peers when using MarkdownCodeBlockNode:
798+
799+
- `stream-markdown` (>=0.0.2)
800+
- `shiki` (^3.13.0)
801+
802+
Install examples:
803+
804+
```bash
805+
# pnpm
806+
pnpm add stream-markdown shiki
807+
808+
# npm
809+
npm install stream-markdown shiki
810+
811+
# yarn
812+
yarn add stream-markdown shiki
813+
```
814+
796815
**When to use MarkdownCodeBlockNode:**
797816
- You want syntax-highlighted code blocks without Monaco Editor dependencies
798817
- You prefer a lighter-weight solution for code display
@@ -1342,10 +1361,10 @@ See the [Monaco Editor Integration](#monaco-editor-integration) section for more
13421361
13431362
**Symptom:** Code blocks show plain text without syntax highlighting when using `MarkdownCodeBlockNode`.
13441363
1345-
**Solution:** Install the `shiki` peer dependency:
1364+
**Solution:** Install the required peers for `MarkdownCodeBlockNode`:
13461365
13471366
```bash
1348-
pnpm add shiki
1367+
pnpm add stream-markdown shiki
13491368
```
13501369
13511370
### TypeScript errors about missing types

README.zh-CN.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ yarn add vue-renderer-markdown vue
5151
|------|------|------|----------------|
5252
| `mermaid` | >=11 | Mermaid 图表 | 展示源代码 |
5353
| `stream-monaco` | >=0.0.2 | Monaco 编辑器 | 仅显示纯文本 |
54+
| `stream-markdown` | >=0.0.2 | `MarkdownCodeBlockNode` 所用的流式高亮渲染器 | 仅显示纯文本 |
5455
| `shiki` | ^3.13.0 | MarkdownCodeBlockNode 语法高亮 | 仅显示纯文本 |
5556
| `vue-i18n` | >=9 | 国际化 | 内置同步翻译器 |
5657

@@ -147,6 +148,24 @@ setCustomComponents({
147148
})
148149
```
149150

151+
使用 MarkdownCodeBlockNode 时需要安装以下 peer 依赖:
152+
153+
- `stream-markdown` (>=0.0.2)
154+
- `shiki` (^3.13.0)
155+
156+
安装示例:
157+
158+
```bash
159+
# pnpm
160+
pnpm add stream-markdown shiki
161+
162+
# npm
163+
npm install stream-markdown shiki
164+
165+
# yarn
166+
yarn add stream-markdown shiki
167+
```
168+
150169
或在实例级启用纯文本:
151170

152171
```vue
@@ -387,10 +406,10 @@ getUseMonaco()
387406
388407
**现象**:使用 `MarkdownCodeBlockNode` 时代码块仅显示纯文本。
389408
390-
**解决方案**:安装 `shiki` 依赖
409+
**解决方案**:安装 `MarkdownCodeBlockNode` 所需依赖
391410
392411
```bash
393-
pnpm add shiki
412+
pnpm add stream-markdown shiki
394413
```
395414

396415
并确保在渲染器中启用了该组件:

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,24 @@
7676
"katex": ">=0.16.22",
7777
"mermaid": ">=11",
7878
"shiki": "^3.13.0",
79+
"stream-markdown": ">=0.0.2",
7980
"stream-monaco": ">=0.0.2",
8081
"vue": ">=3.0.0",
8182
"vue-i18n": ">=9"
8283
},
8384
"peerDependenciesMeta": {
85+
"katex": {
86+
"optional": true
87+
},
8488
"mermaid": {
8589
"optional": true
8690
},
8791
"shiki": {
8892
"optional": true
8993
},
94+
"stream-markdown": {
95+
"optional": true
96+
},
9097
"stream-monaco": {
9198
"optional": true
9299
},

0 commit comments

Comments
 (0)