当 DSH Web 中的消息包含 Mermaid 语法时,通过本地渲染以图像形式预览 Mermaid Diagrams,并允许接入外部渲染服务器。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:baconbao/dsh-mermaid-image-preview
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本。请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
A DeepSeek Harness Plugin for Previewing Mermaid Diagram Images
Preview mermaid syntax as images via local rendering in DSH Web when the chat message contains a mermaid fenced code block (```mermaid or ```mmd ).

Features and how it works
- Preview mermaid diagrams by rendering images directly!
- Local renderer first! If it fails, it can fall back to an external or self-hosted rendering engine by configuring a fallback server.
- Setting card: you can adjust runtime settings in the UI - no restart needed.
- Mount point:
conversation.chat.turnTail(chain slot, additive - never shadows shipped UI). - Thumbnail display: the diagram renders as a thumbnail; click to enlarge in place, click again to shrink back (same element toggles, no popup).
- Light/dark themes follow the UI automatically.
Support diagram types
The plugin renders diagrams locally with a built-in renderer. It supports 14 diagram types out of the box.
Rendered locally: flowchart, sequenceDiagram, classDiagram, stateDiagram, erDiagram, pie, journey, gitGraph, requirementDiagram, timeline, quadrantChart, packet-beta, xychart-beta
Expand: gantt, mindmap, block-beta, sankey-beta, architecture-beta, zenuml, C4Context
[!NOTE] You can enable the fallback to render expanded types — see Configuration below.
Installation
Installation from github
### latest release version
$ npx @deepseek-ai/dsh plugin --profile web add github:baconbao/dsh-mermaid-image-preview#latest
### specific version
$ npx @deepseek-ai/dsh plugin --profile web add github:baconbao/dsh-mermaid-image-preview#<VERSION_TAG|GIT_TAG>
### dev version
$ npx @deepseek-ai/dsh plugin --profile web add github:baconbao/dsh-mermaid-image-preview#dev
Installation from source code
$ git clone https://github.com/baconbao/dsh-mermaid-image-preview
$ cd dsh-mermaid-image-preview
$ pnpm install
$ dsh plugin --profile web add .
[!IMPORTANT] Restart dsh web after installing.
Configuration
Change runtime settings on setting card

The Plugins settings page (Settings > Plugins) shows a Mermaid image preview card where
you can adjust plugin's runtime settings directly - no restart needed.
Values are stored in localStorage and applied immediately across all sessions.
Change render server by profile patch
Diagrams are rendered locally by default. To use your own render server or
enable the external fallback, edit the profile's cordis.patch.yml (e.g.
~/.dsh/profiles/web/cordis.patch.yml):
- id: ui-dsh-mermaid-image-preview
config:
enableLocalRender: true
fallbackRenderUrl: https://mermaid.ink
enableFallback: false
enableLocalRender: render locally (defaulttrue). Setfalseto always use the fallback server (enableFallbackis ignored).fallbackRenderUrl: fallback render server (defaulthttps://mermaid.ink).enableFallback: use the fallback server when local rendering fails (defaultfalse).- Restart dsh web after changing these settings.
- To host your own fallback render server, see https://github.com/jihchi/mermaid.ink for the details.
Uninstallation
$ dsh plugin --profile web remove @baconbao/dsh-mermaid-image-preview
[!NOTE] Since v0.2.0 the plugin/package id is changed from
dsh-mermaid-image-previewto@baconbao/dsh-mermaid-image-preview.
Test
Ask the agent to produce:
```mermaid
graph TD
A[Start] --> B{Success?}
B -->|Yes| C[Done]
B -->|No| D[Retry]
```
Author
baconbao, vibe coding with deepseek ai
License
链接
同类插件
zhu1090093659/dsh-web-ui#packages/dsh-web-ui-all★ 3239
DSH Web UI 插件与皮肤合集:任务看板、git 图、右侧面板、远程移动端 UI、桌宠、实时 token 统计与皮肤中心。
omdsh-dev/DSH-better-sidebar★ 1531
侧边栏完整工作台:内置文件渲染编辑、终端、Git 与子代理,支持三方插件注册新 Tab。
ccch1mneyyy/dsh-TUI★ 1476
Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。
omdsh-dev/dsh-at-file★ 256
Codex 风格的 `@file` 文件引用,输入框里直接搜索并引用工作区文件。
huiliyi37/dsh-tianshu-tui★ 187
DeepSeek Harness 的终端 UI(TUI)。
Nagi-ovo/dsh-visualize★ 148
对话内生成式 UI:模型把交互式 HTML 卡片直接画进会话流,带流式预览与沙箱渲染。