Skip to content
dsh.fish
Bundle

dsh-md-view

Markdown view: markdown rendering for DSH client plugins, exposed through the client service mdView. A thin facade over the harness MarkdownText primitive (GFM, math, footnotes, highlighted code) plus README-ism handling: raw <img> tags and document-relative targets resolved against the repo.

Source
joao-paulo-santos
License
MIT
Updated
Updated 6 days ago

Readme

# dsh-md-view

A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH)
plugin: markdown rendering for client plugins, so every surface that shows
markdown (READMEs, journals, pads) renders it the same way through one
service: the harness's own MarkdownText pipeline (GFM, math, footnotes,
shiki-highlighted code with copy buttons) plus the document-specific
handling chat never needs.

There is no UI of its own to visit. Plugins inject the client service
`mdView`:

```js
// consumer client half, inject: ['mdView', …]

// 1. One markdown document as an element (you keep the layout):
return React.createElement('div', { className: 'mine' },
  ctx.mdView.render(markdownText, { links: { repo: 'owner/name' } }))

// 2. One self-contained document:
const Doc = ctx.mdView.component({ text: markdownText, links: { repo: 'owner/name' } })
return React.createElement(Doc, {})
```

## What it adds to the primitive

- raw `<img>` tags (badges, screenshots) become real images,
- document-relative link and image targets resolve against
  `https://github.com/{repo}/blob/HEAD/...` and the raw content host
  (when `links.repo` is given),
- fenced code blocks and inline code spans are never transformed.

## Contract

- Rendered output is React elements with plain text nodes only; markdown
  can never inject HTML (`<script>` stays visible text, a MarkdownText
  rule).
- `links.repo` is optional; without it relative targets stay as written.
- The wrapper stylesheet is installed once by this plugin; consumers add no
  CSS of their own for markdown.
- No persistence; the host half is a stub.

## How to install

Requires a DeepSeek Harness checkout and a profile, here `web`. The plugin
has no dependencies:

```sh
mkdir -p ~/dsh-plugins && cd ~/dsh-plugins
git clone https://github.com/joao-paulo-santos/dsh-md-view.git

# from the harness checkout
pnpm dsh plugin --profile web add ~/dsh-plugins/dsh-md-view

# verify the profile still composes
pnpm dsh --profile web --dump-config
```

Restart the harness. Plugins that inject the `mdView` service can now
render markdown.

## Dependencies

*(none)*

## Plugins dependent on this

- [dsh-workspace-history](https://github.com/joao-paulo-santos/dsh-workspace-history) renders compaction journal bodies with it (optional; degrades to plain text)
- [dsh-wo-github](https://github.com/joao-paulo-santos/dsh-wo-github) renders repository READMEs with it (optional; degrades to plain text)

Install

dsh plugin --profile web add github:joao-paulo-santos/dsh-md-view

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source