Preview Mermaid diagrams as images via local rendering in DSH Web when the chat message contains a Mermaid fenced code block, and also allow integration with external rendering servers.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:baconbao/dsh-mermaid-image-preview
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a 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
Links
More in this category
zhu1090093659/dsh-web-ui#packages/dsh-web-ui-all★ 3239
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
omdsh-dev/DSH-better-sidebar★ 1531
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
ccch1mneyyy/dsh-TUI★ 1476
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
omdsh-dev/dsh-at-file★ 256
Codex-style `@file` mentions: search workspace files in the composer and attach their contents to prompts.
huiliyi37/dsh-tianshu-tui★ 187
A terminal UI (TUI) for DeepSeek Harness.
Nagi-ovo/dsh-visualize★ 148
In-conversation generative UI: the model renders interactive HTML cards into the chat stream, with streaming preview and sandboxed rendering.