DeepSeek Harness Plugin

Bao-qing/dsh-markdown-craft

Stars ★ 0 Category UI Enhancements Added 2026-12-01

Right-sidebar Markdown workbench with Read, Live, Source and Split modes: block and visual table editing, live KaTeX preview, safe HTML and table math rendering, configurable viewport virtualization, Quote-to-Chat, DSH plugin slot bridging and turn-picker Save-to-Note.

Install

# from a prebuilt release tarball

dsh plugin --profile web add -w "https://github.com/Bao-qing/dsh-markdown-craft/releases/download/v0.6.0/dsh-markdown-craft-0.6.0.tgz"

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:Bao-qing/dsh-markdown-craft

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


Interface Overview

Overall interface preview


Why dsh-markdown-craft?

DeepSeek Harness's native right sidebar only supports read-only paged previews for .md files. Without introducing iframes, build steps, or third-party plugin coupling, dsh-markdown-craft upgrades the right-sidebar .md / .markdown surface into a local-first Markdown note & AI co-writing workbench.

Core Features

1. Four Native Modes (Read · Live · Source · Split)

  • Read: Distraction-free reading view with selection Quote to chat and full plugin content rendering.
  • Live (Notion / Obsidian-style):
    • Click any paragraph, heading, list, quote, or code block to edit in place (keeping heading typography and quote bars while editing) as surrounding blocks remain rendered.
    • Hover the left gutter for + insert block and ⋮⋮ drag-and-drop reorder / block menu (Turn into, Insert above/below, Duplicate, Quote block, Edit source, Delete).
    • Type / on an empty block to open the Slash Command Menu (supports Chinese, Pinyin, and English filtering).
    • Select text while editing to bring up the floating Inline Format Bar (B / I / S / </> / $x$ / 🔗 / Quote).
    • Toggle - [ ] task checkboxes directly; auto-saves gently on block commit; full document-level Ctrl/Cmd+Z Undo / Redo stack.
  • Source: Full raw Markdown editing with Undo-preserving formatting shortcuts and FsVersion optimistic locking.
  • Split (VSCode-style Content-Aligned Synchronized Scroll):
    • Measures true soft-wrapped pixel offsets of every logical line via an offscreen mirror and synchronizes bidirectionally against rendered block anchors; automatically stacks vertically in narrow panes (< 640px).

Live editing:

Live inline editing

Block actions:

Block menu and block conversion


2. Visual Block Editors

  • Visual GFM Table Editor: Click any cell to edit (Tab / Shift+Tab / Enter navigation and auto-row append), add columns/rows from the edges, align columns (left / center / right), insert/delete/reorder rows and columns, and round-trip escaped \| and inline code `a|b` losslessly.
  • Live Split Equation Editor ($$...$$): Real-time KaTeX preview above the LaTeX source editor.
  • Visual YAML Frontmatter (Page properties): Edit key-value metadata and tags pills just like Notion's top properties (safely falls back to source for nested YAML).

3. Safe README HTML & Table Math Rendering

  • Parses common README / OCR HTML (<p align="center">, <h1 align="center">, local/remote <img>, relative file & #heading <a>, <details>/<summary>, <table>, <kbd>, <sub>/<sup>) via DOMParser into a strict allowlisted pure-React tree, supporting allowlisted text-align (left / center / right) and cleanly hiding HTML comments (rendered as a subtle editable pill in Live mode).
  • Text inside HTML table cells and safe HTML containers automatically renders inline KaTeX math ($...$, $$...$$, \(...\), \[...\]) and inline Markdown (bold, italic, strikethrough, inline code, links).
  • Local relative images load through DSH's authenticated file media route; relative links (such as README.en.md, LICENSE, file.md#L38) open directly in the right sidebar with source-line navigation; #heading anchors scroll smoothly; <script>, <iframe>, <style>, and all on* event attributes are stripped completely.

HTML rendering:

Safe README HTML rendering


4. Native DSH Plugin Support (Plugin support)

  • Reuses DSH's native MarkdownBody renderer and dynamically bridges any plugins you have installed through native slot protocols:
    • Mirrors active conversation.chat.markdown.fence plugins (math, diff, patch, and any custom fence plugin).
    • Bridges any installed tool.call.toolview plugin through generic ```dsh-tool:<toolName> fences—supporting both inline JSON and external src="./assets/dsh-tools/*.json" references so large payloads never clutter your Markdown source.
  • Turning off the sparkle Plugin support toggle in the header replaces plugin blocks with a clean in-place placeholder card.

Plugin support: works with any plugin that enhances chat output (example below from deepseek-harness-intelligent-ui)


5. AI Chat Integration (Quote to chat & Save to note)

  • Quote to chat:
    • Drag-selecting rendered Markdown or KaTeX equations automatically pops up Quote to chat (converting selected KaTeX back to clean $...$ / $$...$$ TeX source).
    • Quote whole blocks, tables, or dsh-tool:* cards directly into DSH's composer as native atomic quote cards with @path Lstart-Lend line anchors (clicking line citations in chat also jumps and highlights the target line across all four modes).
  • Turn-Picker Save to note:
    • Click the save-to-note icon on any finalized AI reply to open the turn picker—freely select full turns, individual AI replies, plugin tool views, or your own prompts to create or append to a .md note (large tool payloads automatically externalize to ./assets/dsh-tools/*.json).
    • Also exposes the shared md_craft_export_note agent tool.

Chat integration:

Quote to chat and atomic reference card


6. Large-Document Virtualization & Prerender Settings

  • Built for long documents with hundreds of blocks, dense KaTeX equations, and embedded images (such as PDF/OCR exports):
    • Shared IntersectionObserver viewport lazy mounting + CSS content-visibility: auto isolation, Read-mode contiguous prose coalescing, memoized StudioBlockRow with on-demand gutter SVGs, content-stable React keys, cached anchor-pair Split scroll sync with rAF throttling, and fence-scoped data-chat-flow-kind markers.
  • Open Settings → Plugins → Installed → Markdown craft to tune the Rendering & prerender performance card live:
    • Switch between Low memory / Balanced / Heavy prerender presets or adjust scroll overscan blocks, initial prerender counts, prefetch viewport margin, keep-mounted toggle, virtualization threshold, Read group cap, and Split debounce delay (applied immediately and persisted via .volatile() Host config without restarting the plugin).

Requirements

  • DeepSeek Harness: >= 0.2.2-rc.3
  • Node.js: >= 22.13.0

Installation

From GitHub

In DeepSeek Harness, open Settings → Plugins → Add plugin and enter the repository URL (or a Release .tgz URL):

git+https://github.com/Bao-qing/dsh-markdown-craft.git

From a local directory

git clone https://github.com/Bao-qing/dsh-markdown-craft.git dsh-markdown-craft

In DeepSeek Harness, open Settings → Plugins → Add plugin and select the cloned dsh-markdown-craft directory.

Generic dsh-tool:<name> Syntax

Inline JSON (good for compact payloads):

```dsh-tool:my_tool title="Summary"
{"title": "Summary", "value": 42}
```

External JSON resource (recommended for large payloads):

```dsh-tool:my_tool src="./assets/dsh-tools/my-tool-card.json" title="Summary"
```

Development & Testing

Zero external dependencies and zero build step:

npm run lint:syntax   # Check index.js & client.js syntax
npm test              # Run native node:test unit suite (client parser + Host routes & tool)
npm run check         # Syntax + tests + npm pack --dry-run

License

MIT

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

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