dsh-md-html-render: Render Markdown to a single-file HTML ready to share

Foreword

When executing tasks in DSH (DeepSeek Harness), there is often a type of intermediate output that leaves users unsure where to place it: migration plans drafted by the model, comparison tables, or draft reports. Keeping it in the conversation results in a large chunk of Markdown that becomes messy if copied out; sending it to another renderer requires an extra export step. This plugin solves precisely that step: by installing a renderer within the profile, the model directly generates a self-contained HTML file. The Web GUI features a drawer-style preview and export entry, with both paths backed by the same renderer.

The plugin’s repository directory page is located under the “Client” category on SkillHub, with 1 star. The maintainer is YaoleWu, and the repository address is https://github.com/YaoleWu/dsh-md-preview . Below, we introduce its capabilities, installation methods, and usage considerations.

What is it

In short: md_html_render is a tool callable by the model. Give it Markdown, and it returns a complete, self-contained HTML document, optionally writing it to disk. At the same time, the Web session header features an MD drawer that allows for on-the-spot browsing, rendering, editing, and exporting of Markdown files within the working directory. Both share the single renderer lib/render.js; therefore, the pages generated by the model and those exported by the drawer are byte-for-byte identical. The author has asserted this point in tests for every case in the corpus.

It is positioned to “turn Markdown into a single-file page that can be sent to others and opened on offline machines,” rather than replacing existing Markdown viewers. The slogan in the repository README is “Turn Markdown into a page you can send to someone.” The package version is 0.3.0 and the license is MIT.

Core Features

1. md_html_render Tool

md_html_render(markdown, title?, save_path?) -> { html, savedPath?, error? }

In the callback structure, html is always returned, while savedPath and error only appear when disk writing is involved. Two optional parameters:

  • title: The page <title>, defaults to Markdown.
  • save_path: The target path, parsed via the session’s filesystem service, so it follows the same sandboxing strategy as other writes.

The output is self-contained: styles are embedded, and no external stylesheet, font, script, or image is loaded. Opening from a disk, USB drive, or isolated network machine results in a consistent appearance; it follows the reader’s dark mode; and there are no external requests. If save_path is rejected by the sandbox, the tool will still return the HTML and an error, and the iteration won’t be interrupted by permission issues.

2. Web GUI MD Drawer

Pressing MD in the Web session header opens the drawer on the current working directory. Features include:

  • On-site browsing: Click a folder to enter, use ↑ to go back, without using the system file dialog.
  • Rendering: Titles, bold/italic/strikethrough, inline code, fenced code, blockquotes, ordered/unordered/task lists, tables, links, images, and horizontal rules.
  • Editing: Switch to a plain textarea for taking notes or fixing a single line, then switch back.
  • Export: Write a self-contained HTML next to the source file, which is the same document produced by md_html_render.
  • Theme-aware: Reads the harness’s theme variables; light/dark mode requires no configuration.

3. Security Boundaries

  • No runtime dependencies. The client is mostly loaded as pure scripts without a bundler, so marked / markdown-it are unavailable; the renderer is about 150 lines of hand-written JavaScript, meaning the only file in the dependency tree that needs auditing is itself.
  • No secondary disk channel. All read/write operations go through the harness’s fs service, inheriting the session’s existing sandboxing policies; the drawer’s readFile only accepts .md, .markdown, .mdx, and .txt.
  • No raw HTML execution. Document text is HTML-escaped before running inline syntax; link targets only allow http(s):, #, /, mailto:, with others collapsed to #. Documents containing <script> or javascript: links will be rendered as literal characters.

Compatibility: md_html_render is available in headless / CLI profiles; the Web GUI has both the tool and the drawer; if a profile lacks the fs service, the plugin only logs and remains inactive, performing no partial loading. Requires Node ^22.19.0 || >=24.0.0.

Installation and Enablement

The package was renamed in version 0.3.0: previously the package name was dsh-md-preview, which was registered by another author’s project on npm on 2026-08-17. Consequently, this package changed its publish name to dsh-md-html-render (which is the tool name it has always provided). Installing dsh-md-preview from npm will not get you this package. The repository path remains unchanged, but the dependency key must match the new package name.

It is not yet on npm, so install directly from GitHub. Edit the profile’s package.json:

// ~/.dsh/profiles/<profile>/package.json
{
  "dependencies": {
    "dsh-md-html-render": "github:YaoleWu/dsh-md-preview#v0.3.0"
  },
  "dsh": {
    "profile": {
      "bundles": ["dsh-md-html-render"]
    }
  }
}

The original README wrote github:LeslieWylie/dsh-md-preview#v0.3.0 (the previous owner name). The full_name returned by the GitHub API is now YaoleWu/dsh-md-preview, and the old owner name redirects to the same repository. Both ways point to the same repository; citing by the current owner name is safer.

Then reinstall and restart the profile:

cd ~/.dsh/profiles/<profile> && pnpm install
dsh --profile <profile>

Remove #v0.3.0 to track the default branch instead of a fixed version.

If you don’t want to modify the profile, you can also patch temporarily:

dsh --profile web --patch <(printf -- "- insert:\n    - id: md-preview\n      name: dsh-md-html-render\n")

The package must still be resolvable from the profile’s node_modules, so you must run the pnpm install above first.

Typical Usage

The model side issues a direct command, for example:

Render this migration plan to ~/Desktop/plan.html

This is suitable for converting content like reports, plans, and comparison tables—which would otherwise be piled up as whole paragraphs in the conversation—into HTML files that can be opened or sent directly.

GUI side: Press MD in the session header, browse the working directory, click a .md file to render it on the spot; switch to plain text editing to fix a single line, then switch back; click Export to get a single-file HTML next to the source file.

The repository’s built-in tests have four executable suites, covering the client renderer, the host renderer, and consistency between the two (including tool shape, RPC endpoints, sandbox rejection paths), drawer path rendering, and obtaining md_html_render from the real tool registry after real Context bootstrapping and executing against the real disk:

npm test

The significance of the last item is that a DSH plugin might import cleanly and pass all unit tests, yet register nothing when the Context actually boots, and not report an error—something unit tests cannot see. Harness-related packages are declared as ordinary devDependencies rather than optional peers, so running npm install && npm test directly on a fresh clone actually works. When SKIPPED appears in the logs, treat it as not verified. XSS-related assertions are structural invariants: the generated tags will not have unterminated attributes or on*= handlers. The suite also includes cases that make the linter turn red on truly unsafe tags, preventing security assertions from silently degrading into tautologies.

Use Cases and Notes

Suitable for:
People who use the model in DSH to produce document-like artifacts and want the result to be a file that can be opened and forwarded offline; Web GUI users who want on-the-spot preview without opening a new tab or needing a second editor. Installing the headless profile only gives you the tool, while GUI users get both.

Points to note:
- The plugin runs with the permissions of the current dsh process; the write path is still determined by the session sandbox; check the source code and license before installing (this package’s license is MIT).
- The tool depends on the fs service; on profiles without it, the plugin only logs a warning and remains lazy, leaving the function unavailable.
- The package name dsh-md-preview points to a different project on npm, so do not install using the old name.
- The SkillHub directory is an independent community site with no official affiliation with DeepSeek / Fantopia, so you must evaluate the plugin yourself before using it.

Conclusion

The value of this plugin lies in converging the “Markdown rendering” step inside the harness: a single renderer serves as both a model tool and the preview/export button for the GUI; zero runtime dependencies, no secondary disk channel, no raw HTML execution, and a very small audit surface. The directory page is at https://www.skillhub.cn/plugins/YaoleWu/dsh-md-preview , and the source code is at https://github.com/YaoleWu/dsh-md-preview .

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye