Complete Markdown renderer for file preview AND chat messages — Mermaid diagrams, hand-drawn SVG (mds-diagram), KaTeX math formulas, GFM tables, syntax highlighting. Rendering engine bundled, fully offline. Requires DSH 0.2.2-rc.5+. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-md-studio
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:BioAIEvolu/dsh-md-studio
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 — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
📄 Markdown Studio for DeepSeek Harness
Mermaid diagrams, math formulas and syntax highlighting rendered right inside DSH's native right-sidebar file preview — and in chat messages.
The rendering engine ships with the plugin — fully offline · no document changes needed · disable to restore the stock renderer
If this project helps you, please consider giving it a ⭐ Star to help others discover it!
The same Mermaid block: stock preview vs Markdown Studio
Why
DeepSeek Harness's right-sidebar preview is great — except ```mermaid blocks show up as raw code. Existing workarounds open a separate panel or fetch rendering engines from a CDN.
Markdown Studio takes over the native preview's Markdown renderer: file reads, permission checks, reload and tab lifecycle all stay native — only the drawing is upgraded. Mermaid, markdown-it, KaTeX, highlight.js and DOMPurify ship inside the bundle, so diagrams work offline.
| Stock preview | Markdown Studio |
|---|---|
```mermaid shown as code |
Rendered in place as SVG + toolbar |
✨ Features
- 📈 Mermaid diagrams, chat + documents — the same pipeline renders
```mermaidblocks in chat messages and in opened documents: flowcharts, sequence, gantt, pie and the full Mermaid 11 family; per-diagram toolbar with diagram/source toggle · fullscreen (zoom & pan) · SVG download; automatic re-render on theme change - 🖼️ In-chat hand-written SVG rendering — a bare
<svg>code block in chat (no fence language needed) automatically renders as a themed widget card; models don't have to remember themds-diagramsyntax - 🎯 Diagram contrast guard — chip labels are measured against the shape they actually sit on (WCAG ≥ 4.5:1, opacity included); white-on-pastel text (1.3:1) is auto-corrected to a same-hue ink. The bundled
mds-diagram-designskill ships a zero-dependency checker (check-svg-contrast.mjs), so diagrams never end up "background and text both too pale" - 🩹 Syntax auto-repair — the most common real-world breaker, ASCII parentheses inside node labels (
W2[Codex / Claude Code (ACP)]), is repaired and rendered with an "auto-repaired" badge. No need to edit your documents - 📐 KaTeX math — inline
$...$and display$$...$$ - 📝 Full GFM — tables, task lists, footnotes, heading anchors
- 🎨 Syntax highlighting — highlight.js common languages
- 🖼️ Local images — relative paths resolve beside the document through DSH's authenticated file route
- 📴 Fully offline — zero rendering network requests (asserted by automated tests); remote images authored in the document still load from their URLs
- 🛡️ Secure — DOMPurify sanitization for both document HTML and diagram SVG; scripts never execute; Mermaid runs in
strictmode
📸 Screenshots
| Dark | Light |
|---|---|
![]() |
![]() |
🚀 Install
Requires DeepSeek Harness
0.2.2-rc.5+(validated on 0.2.2-rc.5; see Compatibility)
Option 1 · In-app plugin market (dshmarket) — search dsh-md-studio.
Option 2 · CLI from GitHub
dsh plugin --profile desktop add github:BioAIEvolu/dsh-md-studio
Option 3 · CLI from npm (once published)
dsh plugin --profile desktop add dsh-md-studio
Restart DSH Desktop, then open any .md file in the right sidebar.
📖 Usage
- A Markdown Studio marker and a source toggle appear above the document
- Every Mermaid diagram gets its own toolbar: diagram / source / fullscreen / download SVG
- Fullscreen supports wheel zoom, drag pan and fit
- A broken diagram keeps its source plus the reason — other diagrams still render
- Disable the plugin anytime to restore the stock renderer
Try docs/demo.md — a document covering every feature.
🧠 How it works
No DOM scanning, no floating panel: the plugin registers on DSH's official document-preview slot and takes over the official Markdown key with higher priority.
flowchart LR
A[Open .md file] --> B[DSH native preview]
B --> C{document slot}
C -->|Markdown Studio| D[This renderer]
C -->|other types stay native| E[PDF / image / Excel / code]
D --> F[markdown-it + GFM]
D --> G[Mermaid]
D --> H[KaTeX]
F --> I[DOMPurify]
G --> I
I --> O[Right sidebar tab]
File reading, paging, reload and lifecycle remain DSH's job — the plugin only draws. Slot takeover is verified live via DSH Inspect: this plugin active: true, the official Markdown occupant yields.
✅ Quality
node test/browser.mjs loads the exact shipped bundle in a real Chromium with networking blocked (asserts zero network requests, zero page errors): 4 diagram types with visible labels, auto-repair, GFM, math, highlighting, toggles, fullscreen, SVG download, theme re-render, broken-diagram isolation, XSS sanitization, rapid file switching and disposal. Full list in the Chinese README.
⚠️ Compatibility
- Built for DSH
0.2.2-rc.5(validated on 0.2.2-rc.5) (engines.dsh: >=0.2.2-rc.5 <0.3.0-0); other versions unverified — open an issue if the slot API changes - Limits: 2M chars per document, 50k chars / 2000 lines / 2000 edges per diagram
- Sanitized Mermaid output: diagram interactions and external references are disabled
🛠️ Build from source
pnpm install --ignore-scripts
node scripts/build.mjs # lib/ incl. fonts and license notices
node test/browser.mjs
node test/screenshots.mjs # regenerate docs images
pnpm pack
lib/client.js is shipped in DSH ModuleLoader factory format; only React is required from the host.
🙏 Credits
- dsh-mermaid and dsh-artifact-preview — inspiration for the interaction design
- Libraries: Mermaid · markdown-it · DOMPurify · highlight.js · KaTeX — full notices in THIRD_PARTY_NOTICES.md
⭐ Support
If this plugin saves you time, please star the repo. Issues and PRs welcome — 中文文档.
License
MIT © BioAIEvolu
💖 Support the Project
If this plugin helps you, you can support the project by:
- ⭐ Starring this repo — help others discover it
- 🍴 Forking — contribute or customize your own version
- 🐛 Opening an Issue — report bugs or suggest features
- 📢 Sharing — recommend it to others in DSH communities, forums, or social platforms
Links
More in this category
tt-a1i/archify#integrations/deepseek-harness★ 101863
Generate validated, self-contained interactive architecture, workflow, sequence, data-flow, and lifecycle diagrams from repositories or system descriptions.
dream-num/dsh-univer-office★ 769
Give DeepSeek Harness a real office environment. Univer Office Plugin brings spreadsheets, docs, slides, canvases, relational tables, and more into one runtime — with connected data, validation, versioned changes, and isolated worktrees for multi-agent collaboration.
ECNU/EduWork#dsh-knowledge-studio★ 441
A workspace-based Studio for source-grounded reports, slides, tables, mind maps, quizzes, flashcards, audio and video, using DSH models and shared artifact services. Office generation requires Python 3.12+ with its dependencies and DSH_OFFICE_PYTHON configured; media rendering requires Chromium, and local ASR additionally requires whisper.cpp and a model.
Roland0511/dsh-marktext★ 416
WYSIWYG Markdown editor in the DSH right sidebar, built on MarkText's muya engine: open a .md file, edit it as a rendered document, and save back through ctx.fs with a version guard.
PerryLink/dsh-industry-research★ 227
Deterministic industry research reports for DeepSeek Harness — company and industry research flows produce structured, verifiable reports from staged evidence.
joeseesun/qiaomu-ui-learn-dsh★ 99
Browse UI design references and interaction examples, take design quizzes, and export learning notes as Markdown.


Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.