
lj970926/dsh-plugin-mermaid
30最近提交 2026年8月14日
dsh-plugin-mermaid DSH 插件
一个用于 DeepSeek Harness 的 Web 客户端插件,增强 ```mermaid 代码块为交互式渲染。提供源码与 SVG 图表切换、自动跟随暗色/亮色主题,以及针对流式令牌的防抖重渲染机制。
如何安装 dsh-plugin-mermaid DSH 插件
dsh plugin --profile web add github:lj970926/dsh-plugin-mermaid复制不会执行命令。安装 dsh-plugin-mermaid DSH 插件前请核对仓库和版本。
dsh-plugin-mermaid DSH 插件数据来源
dsh-plugin-mermaid DSH 插件快照日期:2026年8月16日
discovered
dsh-plugin-mermaid DSH 插件能做什么
- 将 ```mermaid 代码块渲染为聊天消息中的交互式 SVG 图表。
- 源码/图表切换按钮,在 Mermaid 源码和渲染图表之间切换。
- 自动跟随 DSH 的暗色/亮色主题。
- 500 毫秒防抖,避免流式令牌更新时频繁重渲染。
- 原生集成 DSH 代码块横幅(按钮位于复制按钮旁边)。
- 按需从 CDN 加载 Mermaid v11,不增加包体积。
dsh-plugin-mermaid DSH 插件适合哪些场景
- 在 DSH 聊天中直接可视化流程图、时序图、类图等 Mermaid 图表。
- 快速在源码和渲染图表之间切换,方便调试或编辑。
- 与流式响应配合使用:防抖机制确保令牌到达时渲染平滑。
- 协作编写文档时嵌入可即时渲染的图表。
dsh-plugin-mermaid DSH 插件适合谁
- 经常在聊天中使用 Mermaid 图表的 DSH 用户。
- 使用 DSH 进行代码生成和文档编写的开发者和技术作家。
dsh-plugin-mermaid DSH 插件的限制
- 需要 DSH >= 0.1.0-rc.6。
- 首次渲染需要网络访问 cdn.jsdelivr.net(之后会被浏览器缓存)。
- 仅适用于 Web 客户端(不适用于终端或其他配置文件)。
- 该插件仍处于早期阶段(兼容 v0.1.0-rc.6)。
dsh-plugin-mermaid DSH 插件的仓库 README 摘录
以下文字摘自 dsh-plugin-mermaid DSH 插件的上游仓库 lj970926/dsh-plugin-mermaid 的 README,版权归原作者,仅作引用。
A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) web client plugin that renders ` ```mermaid ` code blocks in chat messages, with a **chart ↔ source** toggle and live theme switching. - Mermaid v11 loaded on demand from a CDN (no bundle bloat). - Follows DSH dark/light theme automatically. - 500 ms debounce so streaming tokens don't thrash the renderer. - Native DSH code-block banner integration: buttons sit right next to the built-in **Copy** button; source view keeps Shiki highlight and copy. - Zero build step — the browser entry is hand-written factory-form CJS exactly as DSH's `client-modules` service expects. ## Install ### From GitHub (recommended) This package ships prebuilt `lib/` files and declares `dsh.bundle`, so it can be installed directly into the DSH web profile: ```bash dsh plugin --profile web add github:lj970926/dsh-plugin-mermaid ``` Then restart `dsh web` and hard-refresh the browser (Cmd+Shift+R). To pin a revision for reproducibility, append a commit SHA or tag: ```bash dsh plugin --profile web add github:lj970926/dsh-plugin-mermaid#<commit-or-tag> ``` > Because the published files are already in `lib/`, this package has
阅读完整 README仓库许可: MIT
dsh-plugin-mermaid DSH 插件常见问题
如何安装 dsh-plugin-mermaid?
在终端中运行 `dsh plugin --profile web add github:lj970926/dsh-plugin-mermaid`,然后重启 `dsh web` 并强制刷新浏览器(Cmd+Shift+R)。如果需要固定版本,可以在仓库地址后添加 commit SHA 或标签,例如 `#v1.0.0`。
为什么我的 Mermaid 图表没有渲染?
首先确保 DSH 版本 >= 0.1.0-rc.6。该插件首次渲染时需要访问 cdn.jsdelivr.net,如果网络不可用则无法加载。另外检查代码块是否以 ` ```mermaid ` 开头(没有多余空格)。如果图表显示异常,尝试点击重渲染按钮。
我可以在终端 DSH 客户端中使用这个插件吗?
不能,这个插件专门针对 Web 客户端。它使用了浏览器 API(如 MutationObserver 和 DOM 操作),终端客户端不支持这种插件。
如何更改 Mermaid 主题?
插件会自动跟随 DSH 的暗色/亮色主题(在设置→外观中切换)。更改主题后,所有 Mermaid 块都会使用匹配的主题重渲染。你也可以在每个块上点击重渲染按钮强制刷新。
插件是否支持流式响应?
支持。插件使用 500 毫秒防抖,避免每次令牌到达都重渲染。流稳定后才会渲染图表。如果看到不完整的图表,请等待流结束或点击重渲染按钮。