Introduction

In the DSH (DeepSeek Harness) development workflow, developers often need to view Markdown documents (such as prompt templates, configuration instructions, and development logs) in the sidebar. By default, the sidebar only displays plain text, resulting in a poor reading experience, and frequently switching between edit/preview modes reduces efficiency. The dsh-md-viewer plugin intercepts file-opening behavior and directly provides a richly rendered preview in dsh-better-sidebar.

Plugin Overview

dsh-md-viewer is a client-side web plugin maintained by 2017java. By relying on the services of dsh-better-sidebar, it displays .md files in a richly rendered view, supporting features such as code highlighting, tables, and table-of-contents navigation.

Core Features

  • Full Markdown rendering: Supports basic syntax including headings, paragraphs, lists, blockquotes, dividers, links, images, and pipe tables.
  • Code block enhancements: Supports syntax highlighting for js/ts/py/bash/json/yaml/html/css; provides a one-click copy button and a language badge.
  • Table of contents and navigation: Automatically generates a table of contents (TOC), and clicking a TOC item smoothly scrolls to the corresponding position.
  • HTML handling and security: Correctly parses elements such as <img>, <a>, and <br>, handles HTML entities, and strips HTML comments. Uses pure React rendering and does not use innerHTML, avoiding XSS risks.
  • Conversation integration: In conversations, clicking DSH’s built-in “output file” chips can directly open and render a preview in the sidebar.

Installation and Enabling

This plugin depends on dsh-better-sidebar. Before installing, please ensure that this component has been installed.

  1. Install the plugin:
dsh plugin --profile web add dsh-md-viewer@latest
  1. After installation is complete, perform a hard refresh in the browser (Cmd/Ctrl + Shift + R) to load the new module.

Typical Usage

  • File preview: Open any .md or .markdown file in dsh-better-sidebar to see a formatted rich text preview.
  • Conversation integration: In the conversation flow, when the model outputs a file or you click the “output file” chips, the plugin is automatically invoked to render a preview in the sidebar.

Limitations and Notes

  • Dependency requirement: dsh-better-sidebar must be installed. If it is not installed, this plugin will not take effect (as a safe no-op).
  • Image paths: Relative image paths in Markdown will not be automatically resolved based on the file directory; src must be rewritten in the component based on props.path.
  • Missing features: Does not support GFM task lists, LaTeX math formulas, Mermaid diagrams, or footnotes. For full functionality, consider using the dsh-md-overlay standalone preview component.

Summary

dsh-md-viewer provides DSH users with a simple, secure, and feature-rich solution for viewing Markdown documents in the sidebar. Through a standardized file viewer registration mechanism, it seamlessly integrates into the existing sidebar workflow.

Plugin Directory
GitHub Repository