baconbao/dsh-mermaid-image-preview
A DeepSeek Harness Plugin for Previewing Mermaid Diagram by Images in Chat Sessions
已收录
2
Docs
Bundle 已验证
预览
功能介绍
当 DSH Web 中的消息包含 Mermaid 语法时,通过本地渲染以图像形式预览 Mermaid Diagrams,并允许接入外部渲染服务器。
适合
- 经常在 DSH Web 对话中接收 Mermaid 代码块并希望立即查看图像预览的用户。
- 需要本地渲染常见 Mermaid 图表,并可选择外部或自托管后备服务的团队。
不适合
- 很少包含 Mermaid 图表的对话,安装后带来的价值有限。
- 离线且需要 14 种本地支持类型之外图表的流程;扩展类型需要后备渲染器。
README
dsh-mermaid-image-preview
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 ormmd ).

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
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:baconbao/dsh-mermaid-image-preview。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。