dsh-at-file
FSMargoo/dsh-at-fileCodex 风格的 `@file` 文件引用,输入框里直接搜索并引用工作区文件。
dock 系列 Markdown 查看器:GFM 渲染 + DOMPurify 消毒、文档大纲、相对路径图片/链接解析,可一键切换编辑。
The best Markdown viewer plugin in the DSH ecosystem — no contest. GFM rendering, DOMPurify sanitization, a document outline, relative image/link resolution and one-click switch to editing — for READMEs, docs or drafts, dock-markdown gives Markdown an editor-grade experience in DSH for the first time.
Markdown viewer plugin of the dock family: registers the markdown file viewer (md / markdown / mdx) against the dock-files file domain plus the matching editor-area view. File content is read through dock-editor's /desk-editor/fs.read route, rendered with marked + DOMPurify into sanitized HTML, with a one-click switch to editing in dock-editor.
#anchor links smooth-scroll to the matching heading.| Dependency | Type | Notes |
|---|---|---|
| dock >= 0.1.0 | peer (required) | workbench shell: the editor-area view, floating windows and ctx.workbench come from it |
| dock-files >= 0.1.0 | peer (required) | file-domain service: dock-markdown is dispatched as the markdown viewer |
| dock-editor >= 0.1.0 | peer (required) | provides /desk-editor/fs.read for file content and the editor view that the one-click switch opens |
| DSH Web environment | runtime | required; client platform is Web |
cordis ^4.0.0-rc.7 | peer | plugin framework (ships with DSH) |
react ^18.2.0 | peer (optional) | needed for client rendering; without it the viewer UI does not activate |
marked / dompurify | bundled (build-time) | GFM rendering and sanitization; shipped with the plugin, no separate install needed |
Requires dock, dock-files and dock-editor (the view switch opens its editor view):
Recommended install from the npm registry:
dsh plugin --profile web add dock-base
dsh plugin --profile web add dock-files
dsh plugin --profile web add dock-editor
dsh plugin --profile web add dock-markdown
Or install from GitHub (alternative):
dsh plugin --profile web add github:AKS1st/dock
dsh plugin --profile web add github:AKS1st/dock-files
dsh plugin --profile web add github:AKS1st/dock-editor
dsh plugin --profile web add github:AKS1st/dock-markdown
All raw HTML produced by marked passes through DOMPurify.sanitize() (default allowlist) before touching the DOM; dangerouslySetInnerHTML is only used on sanitized output. Known trade-off: DOMPurify's defaults allow the style attribute, so a malicious Markdown file could in theory use CSS for external tracking — add FORBID_ATTR: ['style'] if you need stricter sanitization.
Relative assets are not confined to the session workspace: a Markdown file can live anywhere on the host (the conversation context may mention files outside it, e.g. ~/.dsh/skills/...), and its relative images / internal links resolve with the priority Markdown directory → git repository root → session workspace root — any existing candidate file is served.
MIT